Class Phalcon\Mvc\Model\Validator\PresenceOf

Allows to validate if a filed have a value different of null and empty string (“”)

This validator is only for use with Phalcon\Mvc\Collection. If you are using
Phalcon\Mvc\Model, please use the validators provided by Phalcon\Validation.

<?phpusePhalcon\Mvc\Model\Validator\PresenceOf;classSubscriptorsextends\Phalcon\Mvc\Collection{publicfunctionvalidation(){$this->validate(newPresenceOf(["field"=>"name","message"=>"The name is required",]));if($this->validationHasFailed()===true){returnfalse;}}}