for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* @copyright Copyright (c) Flipbox Digital Limited
* @license https://github.com/flipboxfactory/craft-ember/blob/master/LICENSE
* @link https://github.com/flipboxfactory/craft-ember/
*/
namespace flipbox\craft\ember\models;
use craft\validators\HandleValidator;
use yii\base\Model;
* @property string|null $handle
*
* @author Flipbox Factory <[email protected]>
* @since 2.0.0
trait HandleRulesTrait
{
* @var array
protected $reservedHandleWords = [
'id',
'uid',
];
* @var int
protected $handleLength = 150;
* @inheritdoc
public function handleRules()
return [
[
'handle'
],
HandleValidator::class,
'reservedWords' => $this->reservedHandleWords
'required'
'string',
'max' => $this->handleLength
'safe',
'on' => [
Model::SCENARIO_DEFAULT
]
}