public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { parent::validateForUpdate($sourceObject, $propertiesToSkip); if ($this->partnerId !== null) { $this->validatePartnerId(); } $this->validatePropertyMinLength("name", 1, true); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { /* @var $sourceObject entry */ $this->validateUsers(); $this->validateCategories(); $this->validatePropertyMinLength('referenceId', 2, true); // if($this->referenceId) // { // $c = KalturaCriteria::create(entryPeer::OM_CLASS); // $c->add('entry.ID', $sourceObject->getId(), Criteria::NOT_EQUAL); // $c->add('entry.REFERENCE_ID', $this->referenceId); // $c->applyFilters(); // if(count($c->getFetchedIds())) // throw new KalturaAPIException(KalturaErrors::REFERENCE_ID_ALREADY_EXISTS, $this->referenceId); // } $this->validateObjectsExist($sourceObject); return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { /* @var $sourceObject accessControl */ $this->validatePropertyMinMaxLength('name', 1, 128, true); $this->validate(); if ($this->systemName) { $c = KalturaCriteria::create(accessControlPeer::OM_CLASS); $c->add(accessControlPeer::ID, $sourceObject->getId(), Criteria::NOT_EQUAL); $c->add(accessControlPeer::SYSTEM_NAME, $this->systemName); if (accessControlPeer::doCount($c)) { throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName); } } return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { if ($this->tags !== null) { $this->validatePropertyMaxLength("tags", CuePointPeer::MAX_TAGS_LENGTH); } if ($this->entryId !== null) { $this->validateEntryId($sourceObject->getId()); } if ($this->startTime !== null) { $this->validateStartTime($sourceObject->getId()); } $propertiesToSkip[] = 'cuePointType'; return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { $this->validatePropertyMinLength('name', 3, true); $this->validate($sourceObject); return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdateByType($sourceObject, $propertiesToSkip = array(), $type) { $this->validateMandatoryAttributes(); $this->validateDuplications($sourceObject->getId(), $type); return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { if ($this->name !== null) { $this->validatePropertyMinLength("name", 1); $this->validatePropertyMaxLength("name", categoryPeer::MAX_CATEGORY_NAME); } if ($this->parentId !== null) { $this->validateParentId(); } elseif ($this->inheritanceType == KalturaInheritanceType::INHERIT && ($this->parentId instanceof KalturaNullField || $sourceObject->getParentId() == null)) { //cannot inherit member with no parant throw new KalturaAPIException(KalturaErrors::CANNOT_INHERIT_MEMBERS_WHEN_PARENT_CATEGORY_IS_NOT_SET); } $this->validateCategory($sourceObject); return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { $propertiesToSkip[] = 'type'; return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { $audioThumbEntryId = $this->audioThumbEntryId; if ($audioThumbEntryId) { $audioThumbEntry = entryPeer::retrieveByPK($audioThumbEntryId); if (!$audioThumbEntry || $audioThumbEntry->getMediaType() != entry::ENTRY_MEDIA_TYPE_IMAGE) { throw new KalturaAPIException(SystemPartnerErrors::PARTNER_AUDIO_THUMB_ENTRY_ID_ERROR, $audioThumbEntryId); } } $liveThumbEntryId = $this->liveThumbEntryId; if ($liveThumbEntryId) { $liveThumbEntry = entryPeer::retrieveByPK($liveThumbEntryId); if (!$liveThumbEntry || $liveThumbEntry->getMediaType() != entry::ENTRY_MEDIA_TYPE_IMAGE) { throw new KalturaAPIException(SystemPartnerErrors::PARTNER_LIVE_THUMB_ENTRY_ID_ERROR, $liveThumbEntryId); } } return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { $this->validatePropertyMinLength("name", 1, true); if ($this->systemName) { $c = KalturaCriteria::create(StorageProfilePeer::OM_CLASS); $c->add(StorageProfilePeer::ID, $sourceObject->getId(), Criteria::NOT_EQUAL); $c->add(StorageProfilePeer::SYSTEM_NAME, $this->systemName); if (StorageProfilePeer::doCount($c)) { throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName); } } return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = null) { /* @var $sourceObject categoryKuser */ $category = categoryPeer::retrieveByPK($sourceObject->getCategoryId()); if (!$category) { throw new KalturaAPIException(KalturaErrors::CATEGORY_NOT_FOUND, $sourceObject->getCategoryId()); } if ($this->permissionNames && $this->permissionNames != $sourceObject->getPermissionNames()) { if ($sourceObject->getKuserId() == $category->getKuserId()) { if (strpos($this->permissionNames, PermissionName::CATEGORY_EDIT) === false) { throw new KalturaAPIException(KalturaErrors::CANNOT_UPDATE_CATEGORY_USER_OWNER); } } } $currentKuserCategoryKuser = categoryKuserPeer::retrievePermittedKuserInCategory($sourceObject->getCategoryId(), kCurrentContext::getCurrentKsKuserId()); if (kEntitlementUtils::getEntitlementEnforcement() && (!$currentKuserCategoryKuser || !$currentKuserCategoryKuser->hasPermission(PermissionName::CATEGORY_EDIT))) { throw new KalturaAPIException(KalturaErrors::CANNOT_UPDATE_CATEGORY_USER, $sourceObject->getCategoryId()); } return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject, $propertiesToSkip = array()) { $this->validatePropertyMinLength("name", 1, true); if ($this->systemName) { $c = KalturaCriteria::create(conversionProfile2Peer::OM_CLASS); $c->add(conversionProfile2Peer::ID, $sourceObject->getId(), Criteria::NOT_EQUAL); $c->add(conversionProfile2Peer::SYSTEM_NAME, $this->systemName); if (conversionProfile2Peer::doCount($c)) { throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName); } } if (!is_null($this->flavorParamsIds) && !$this->flavorParamsIds instanceof KalturaNullField) { $this->validateFlavorParamsIds(); } $this->validateDefaultEntry(); return parent::validateForUpdate($sourceObject, $propertiesToSkip); }
public function validateForUpdate($sourceObject = null, $propertiesToSkip = array()) { $this->validatePropertyNotNull('categoryId'); $this->validatePropertyNotNull('entryId'); parent::validateForUpdate($sourceObject, $propertiesToSkip); }