diff --git a/app/library/App/Model/Users.php b/app/library/App/Model/Users.php new file mode 100644 index 0000000..c1df29b --- /dev/null +++ b/app/library/App/Model/Users.php @@ -0,0 +1,122 @@ +add( + 'email', + new EmailValidator( + [ + 'model' => $this, + 'message' => 'Please enter a correct email address', + ] + ) + ); + + return $this->validate($validator); + } + + /** + * Initialize method for model. + */ + public function initialize() + { + $this->setSchema("public"); + } + + /** + * Returns table name mapped in the model. + * + * @return string + */ + public function getSource() + { + return 'users'; + } + + /** + * Allows to query a set of records that match the specified conditions + * + * @param mixed $parameters + * @return Users[]|Users + */ + public static function find($parameters = null) + { + return parent::find($parameters); + } + + /** + * Allows to query the first record that match the specified conditions + * + * @param mixed $parameters + * @return Users + */ + public static function findFirst($parameters = null) + { + return parent::findFirst($parameters); + } + +} -- libgit2 0.21.4