Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Přidaní podpory MetaDataProperty::addSetter, addGetter #46

Open
PetrP opened this issue Jul 2, 2012 · 1 comment
Open

Přidaní podpory MetaDataProperty::addSetter, addGetter #46

PetrP opened this issue Jul 2, 2012 · 1 comment
Labels
Milestone

Comments

@PetrP
Copy link
Owner

PetrP commented Jul 2, 2012

http://orm.petrprochazka.com/forum/post/461/#p461

Zvazuji přidání Orm\MetaDataProperty::addSetter a Orm\MetaDataProperty::addGetter do 0.4 (možná se to dostane až do 0.5)

/** @property int|NULL $ic {emptyStringToNull} */
class User extends BaseEntity
{
} 
class MyMetaDataProperty extends Orm\MetaDataProperty
{
    public function setEmptyStringToNull()
    {
        $this->addSetter(function ($value) {
            if ($value === '')
            {
                $value = NULL;
            }
            return $value;
        });
    }
}
@PetrP
Copy link
Owner Author

PetrP commented Aug 14, 2012

Presunuto do milestonu 0.5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant