Mvc\Model\Validator\StringLength

extends abstract class Phalcon\Mvc\Model\Validator implements Phalcon\Mvc\Model\ValidatorInterface Source on GitHub Simply validates specified string length constraints use Phalcon\Mvc\Model\Validator\StringLength as StringLengthValidator; class Subscriptors extends \Phalcon\Mvc\Model { public function validation() { $this->validate(new StringLengthValidator(array( "field" => 'name_last', 'max' => 50, 'min' => 2, 'messageMaximum'

Mvc\Model\Validator\StringLength::validate

public validate (Phalcon\Mvc\EntityInterface $record) Executes the validator

Mvc\Model\Validator\Url

extends abstract class Phalcon\Mvc\Model\Validator implements Phalcon\Mvc\Model\ValidatorInterface Source on GitHub Allows to validate if a field has a url format use Phalcon\Mvc\Model\Validator\Url as UrlValidator; class Posts extends \Phalcon\Mvc\Model { public function validation() { $this->validate(new UrlValidator(array( 'field' => 'source_url' ))); if ($this->validationHasFailed() == true) { return false; } } } Methods public

Mvc\Model\Validator\Uniqueness::validate

public validate (Phalcon\Mvc\EntityInterface $record) Executes the validator

Mvc\Model\Validator\Uniqueness

extends abstract class Phalcon\Mvc\Model\Validator implements Phalcon\Mvc\Model\ValidatorInterface Source on GitHub Validates that a field or a combination of a set of fields are not present more than once in the existing records of the related table use Phalcon\Mvc\Model; use Phalcon\Mvc\Model\Validator\Uniqueness; class Subscriptors extends Model { public function validation() { $this->validate(new Uniqueness(array( "field" => "email", "message" => "

Mvc\Model\Validator\Regex::validate

public validate (Phalcon\Mvc\EntityInterface $record) Executes the validator

Mvc\Model\Validator\PresenceOf

extends abstract class Phalcon\Mvc\Model\Validator implements Phalcon\Mvc\Model\ValidatorInterface Source on GitHub Allows to validate if a filed have a value different of null and empty string (“”) use Phalcon\Mvc\Model\Validator\PresenceOf; class Subscriptors extends \Phalcon\Mvc\Model { public function validation() { $this->validate(new PresenceOf(array( "field" => 'name', "message" => 'The name is required' ))); if ($this->validationHa

Mvc\Model\Validator\PresenceOf::validate

public validate (Phalcon\Mvc\EntityInterface $record) Executes the validator

Mvc\Model\Validator\Regex

extends abstract class Phalcon\Mvc\Model\Validator implements Phalcon\Mvc\Model\ValidatorInterface Source on GitHub Allows validate if the value of a field matches a regular expression use Phalcon\Mvc\Model\Validator\Regex as RegexValidator; class Subscriptors extends \Phalcon\Mvc\Model { public function validation() { $this->validate(new RegexValidator(array( "field" => 'created_at', 'pattern' => '/^[0-9]{4}[-\/](0[1-9]|1[12])[-\/](0[1-9]|[12][0-9]|3[01

Mvc\Model\Validator\Ip::validate

public validate (Phalcon\Mvc\EntityInterface $record) Executes the validator