for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Bluz PHP Team
* @link https://github.com/bluzphp/skeleton
*/
* @namespace
namespace Application\ContactUs;
use Bluz\Validator\Traits\Validator;
use Bluz\Validator\Validator as v;
* Options Row
*
* @property int $id
* @property string $name
* @property string $email
* @property string $subject
* @property string $message
* @property boolean $mark_read
* @property boolean $mark_answered
* @property string $created
* @property string $updated
* @category Application
* @package ContactUs
class Row extends \Bluz\Db\Row
{
use Validator;
* {@inheritdoc}
protected function beforeSave()
$this->addValidator(
'name',
v::required()->setError('Value is required')
);
'email',
v::required()->setError('Value is required'),
v::email()->setError('Please fill correct email address')
'message',
}
public function beforeInsert()
$this->created = gmdate('Y-m-d H:i:s');
protected function beforeUpdate()
$this->updated = gmdate('Y-m-d H:i:s');