New to Yii. Unsure why this does not work.
<?php
namespace app\models\video;
use Yii;
/**
* This is the model class for table "vjobq4".
*
* @property integer $id
* @property integer $vid
...
* @property string $encoded
* @property string $meta
* @property integer $priority
*/
class Job extends \yii\db\ActiveRecord
{
...
/**
* @inheritdoc
*/
public function rules()
{
\stewlog::bm('model/video/Job JOB RULES');
return [
...
[['status', 'data', 'result', 'errors', 'encoded','meta'], 'string'],
];
}
/**
* @inheritdoc
*/
public function attributeLabels()
{
\stewlog::bm('model/video/Job ATTR LABS');
return [
'id' => Yii::t('app', 'ID'),
'vid' => Yii::t('app', 'Vid'),
...
'meta' => Yii::t('app', 'Meta'),
'priority' => Yii::t('app', 'Priority'),
];
}
/**
* @inheritdoc
* @return JobQuery the active query used by this AR class.
*/
public static function find()
{
\stewlog::bm('model/video/Job FIND');
return new JobQuery(get_called_class());
}
public function setMeta($v)
{
\stewlog::bm('model/video/Job SETMETA');
return json_decode(serialize($v));
}
public function getMeta()
{
\stewlog::bm('model/video/Job GETMETA');
return json_encode(unserialize($this->meta));
}
}
I can verify this model is the one used, but I never see the call to getMeta.
I expected to see the "meta" field unserialized and formatted as JSON. I see the raw mysql data instead, and I get no notice in my log that GETMETA was called ?
What have I overlooked?