From 0b7fb0e579f37c66067a05c5350f8d074edd1b95 Mon Sep 17 00:00:00 2001 From: Alex Savenko Date: Wed, 8 Feb 2017 13:09:08 -0500 Subject: [PATCH] test --- app/library/App/Model/Users.php | 122 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 122 insertions(+), 0 deletions(-) create mode 100644 app/library/App/Model/Users.php 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