/** * @param string $identifier * @return int */ public function removeScope($identifier) { /** @var \yii\db\ActiveRecord $obj */ $obj = ScopesModel::findOne(['id' => $identifier]); if ($obj) { return $obj->delete(); } return 0; }