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í makra {validate} do property anotace entit. #52

Open
PetrP opened this issue Sep 10, 2012 · 0 comments
Open

Přidaní makra {validate} do property anotace entit. #52

PetrP opened this issue Sep 10, 2012 · 0 comments
Assignees
Labels
Milestone

Comments

@PetrP
Copy link
Owner

PetrP commented Sep 10, 2012

/**
 * @property string $foo {validate Nette\Utils\Validators::isEmail}
 * @property string $hexadecimal {validate ctype_xdigit}
 */
class Foo extends Orm\Entity
/**
 * @property string $foo {validate self::validateFoo}
 */
class Foo extends Orm\Entity
{
  protected function validateFoo($value)
  {
    return preg_match('#^a#', $value);
  }
}
/**
 * @property string $name {validate !empty}
 */
class Foo extends Orm\Entity
/**
 * @property string $filePath {validate is_file} {validate is_readable} {validate is_writable}
 */
class Foo extends Orm\Entity
/**
 * @property int $number {validate > 0}
 * @property int $percent {validate >= 0} {validate <= 0}
 * @property string $name {validate !== ''}
 */
class Foo extends Orm\Entity
@ghost ghost assigned PetrP Sep 11, 2012
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