protected static function getClassNameModel(array $row) { $classNameModel = parent::getClassNameModel($row); if ($classNameModel === static::className() || is_subclass_of($classNameModel, static::className()) || in_array(static::className(), class_parents($classNameModel))) { return $classNameModel; } throw new ObjectException('Could not to get non subclass of ' . static::className()); }