255], [['number' ], 'unique'], ]; } public function behaviors() { return [ [ 'class' => TimestampBehavior::className(), //mentés előtt kitölti a save methódus meghívása előtt kitölti a created... mezőket 'value' => function(){ return date('Y-m-d H:i:s' ); } ] ]; } /** * @inheritdoc Minden modelnak van egy Attribut labels függvénye ami modelhez tartalmazza a fordítások */ public function attributeLabels() { return [ 'id_key' => Yii::t('common/key', 'Id Key'), 'number' => Yii::t('common/key', 'Number'), 'status' => Yii::t('common/key', 'Status'), 'type' => Yii::t('common/key', 'Type'), 'created_at' => Yii::t('common/key', 'Created At'), 'updated_at' => Yii::t('common/key', 'Updated At'), ]; } static function statuses() { return [ self::STATUS_ACTIVE => Yii::t('common/key', 'Active'), // t - translate a key a kategoria common/messages/hu/common/key.php mappa (létre kell hozni a fájlt) self::STATUS_DELETED => Yii::t('common/key', 'Inactive'), ]; } }