コード例 #1
0
 public function update(models\ModelAbstract $model)
 {
     if (!strlen((string) $model->getId())) {
         throw new AppEx\InvalidArgumentException('Supplied supplServices model must have an Id', \Application\Error\ValidationCodes::MODEL_SUPPL_SERVICE_PACK);
     }
     if ($model->getPublished() == \Application\Model\SupplServicesModel::STATUS_PUBLISHED) {
         // If the supplementary service pack is published, applicationOriginatedSmsMsisdn,
         // currency can't be updated
         if ($model->getCurrency()) {
             unset($model->currency);
         }
     }
     return parent::update($model);
 }