public function validate($model, $exceptions = false, ModelAbstractValidate $validator = null, $removeNotPresentFields = false) { if (!$validator) { if ($model instanceof TariffPlanLifeCycleModel) { $validator = new \Application\Model\Validate\TariffPlanLifeCycleValidate(); } else { if ($model instanceof TariffPlanServicesModel) { $validator = new \Application\Model\Validate\TariffPlanServicesValidate(); } else { return array('Model' => "Data must be a tariff."); } } } return parent::validate($model, $exceptions, $validator, $removeNotPresentFields); }