コード例 #1
0
 public function validateForInsert($propertiesToSkip = array())
 {
     parent::validateForInsert($propertiesToSkip);
     $this->validatePartnerId();
     $this->validatePropertyMinLength("name", 1);
     $this->validatePropertyMinLength("query", 1);
 }
コード例 #2
0
ファイル: KalturaBaseEntry.php プロジェクト: DBezemer/server
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validateUsers();
     $this->validateCategories();
     $this->validatePropertyMinLength('referenceId', 2, true);
     $this->validateObjectsExist();
     $this->validateParentEntryId();
     //		if($this->referenceId)
     //		{
     //			$c = KalturaCriteria::create(entryPeer::OM_CLASS);
     //			$c->add('entry.REFERENCE_ID', $this->referenceId);
     //			$c->applyFilters();
     //			if(count($c->getFetchedIds()))
     //				throw new KalturaAPIException(KalturaErrors::REFERENCE_ID_ALREADY_EXISTS, $this->referenceId);
     //		}
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #3
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyMinMaxLength('name', 1, 128);
     $this->validate();
     if ($this->systemName) {
         $c = KalturaCriteria::create(accessControlPeer::OM_CLASS);
         $c->add(accessControlPeer::SYSTEM_NAME, $this->systemName);
         if (accessControlPeer::doCount($c)) {
             throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName);
         }
     }
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #4
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyNotNull("entryId");
     $this->validatePropertyNotNull("distributionProfileId");
     parent::validateForInsert($propertiesToSkip);
 }
コード例 #5
0
ファイル: KalturaCuePoint.php プロジェクト: DBezemer/server
 public function validateForInsert($propertiesToSkip = array())
 {
     $propertiesToSkip[] = 'cuePointType';
     parent::validateForInsert($propertiesToSkip);
     $this->validatePropertyNotNull("entryId");
     $this->validateEntryId();
     $this->validateStartTime();
     if ($this->tags != null) {
         $this->validatePropertyMaxLength("tags", CuePointPeer::MAX_TAGS_LENGTH);
     }
 }
コード例 #6
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyMinLength('name', 3, false);
     $this->validate();
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #7
0
ファイル: KalturaServerNode.php プロジェクト: dozernz/server
 public function validateForInsertByType($propertiesToSkip, $type)
 {
     $this->validateMandatoryAttributes(true);
     $this->validateDuplications(null, $type);
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #8
0
ファイル: KalturaCategory.php プロジェクト: DBezemer/server
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyMinLength("name", 1);
     $this->validatePropertyMaxLength("name", categoryPeer::MAX_CATEGORY_NAME);
     $this->validateCategory();
     if ($this->parentId !== null) {
         $this->validateParentId();
     } elseif ($this->inheritanceType == KalturaInheritanceType::INHERIT) {
         //cannot inherit member with no parant
         throw new KalturaAPIException(KalturaErrors::CANNOT_INHERIT_MEMBERS_WHEN_PARENT_CATEGORY_IS_NOT_SET);
     }
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #9
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyNotNull('type');
     $propertiesToSkip[] = 'type';
     return parent::validateForInsert($propertiesToSkip);
 }
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyMinLength("name", 1);
     if ($this->systemName) {
         $c = KalturaCriteria::create(StorageProfilePeer::OM_CLASS);
         $c->add(StorageProfilePeer::SYSTEM_NAME, $this->systemName);
         if (StorageProfilePeer::doCount($c)) {
             throw new KalturaAPIException(KalturaErrors::SYSTEM_NAME_ALREADY_EXISTS, $this->systemName);
         }
     }
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #11
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $category = categoryPeer::retrieveByPK($this->categoryId);
     if (!$category) {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_NOT_FOUND, $this->categoryId);
     }
     if ($category->getInheritanceType() == InheritanceType::INHERIT) {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_INHERIT_MEMBERS, $this->categoryId);
     }
     $partnerId = kCurrentContext::$partner_id ? kCurrentContext::$partner_id : kCurrentContext::$ks_partner_id;
     $kuser = kuserPeer::getKuserByPartnerAndUid($partnerId, $this->userId);
     if ($kuser) {
         $categoryKuser = categoryKuserPeer::retrieveByCategoryIdAndKuserId($this->categoryId, $kuser->getId());
         if ($categoryKuser) {
             throw new KalturaAPIException(KalturaErrors::CATEGORY_USER_ALREADY_EXISTS);
         }
     }
     $currentKuserCategoryKuser = categoryKuserPeer::retrievePermittedKuserInCategory($this->categoryId, kCurrentContext::getCurrentKsKuserId());
     if ((!$currentKuserCategoryKuser || $currentKuserCategoryKuser->getPermissionLevel() != CategoryKuserPermissionLevel::MANAGER) && $category->getUserJoinPolicy() == UserJoinPolicyType::NOT_ALLOWED && kEntitlementUtils::getEntitlementEnforcement()) {
         throw new KalturaAPIException(KalturaErrors::CATEGORY_USER_JOIN_NOT_ALLOWED, $this->categoryId);
     }
     //if user doesn't exists - create it
     if (!$kuser) {
         if (!preg_match(kuser::PUSER_ID_REGEXP, $this->userId)) {
             throw new KalturaAPIException(KalturaErrors::INVALID_FIELD_VALUE, 'userId');
         }
         kuserPeer::createKuserForPartner($partnerId, $this->userId);
     }
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #12
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyNotNull('categoryId');
     $this->validatePropertyNotNull('entryId');
     parent::validateForInsert($propertiesToSkip);
 }
コード例 #13
0
ファイル: KalturaEdgeServer.php プロジェクト: AdiTal/server
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validateMandatoryAttributes(true);
     $this->validateDuplications();
     return parent::validateForInsert($propertiesToSkip);
 }
コード例 #14
0
 public function validateForInsert($propertiesToSkip = array())
 {
     $this->validatePropertyMinLength('name', 3, false);
     $this->validatePropertyMinLength('systemName', 3, true);
     $this->validatePropertyNotNull('objectFilterEngineType');
     $this->validatePropertyNotNull('objectFilter');
     $this->validatePropertyNotNull('objectTasks');
     $this->validatePropertyNotNull('maxTotalCountAllowed');
     foreach ($this->objectTasks as $objectTask) {
         /* @var KalturaObjectTask $objectTask */
         $objectTask->validateForInsert(array('type'));
     }
     parent::validateForInsert($propertiesToSkip);
 }