public function init()
{
parent::init();
if (empty($this->model)) {
throw new InvalidConfigException("Property {model} cannot be blank");
}
$hasFileBehavior = false;
foreach ($this->model->getBehaviors() as $behavior) {
if (is_a($behavior, FileBehavior::className())) {
$hasFileBehavior = true;
}
}
if (!$hasFileBehavior) {
throw new InvalidConfigException("The behavior {FileBehavior} has not been attached to the model.");
}
}