public function saveNewMeta($type, $targetId, $do)
{
$data = ['target_id' => $targetId, 'user_id' => Yii::$app->user->id, 'target_type' => $type, 'type' => $do];
$this->deleteAll($data);
$model = $this->find()->where($data)->one();
$this->setAttributes($data);
if (!$model) {
if ($this->save()) {
return true;
} else {
return array_values($this->getFirstErrors())[0];
}
}
}