public function fromObject($sourceObject)
 {
     parent::fromObject($sourceObject);
     $this->mediaFiles = KalturaDistributionRemoteMediaFileArray::fromDbArray($sourceObject->getMediaFiles());
     if (!$this->distributionProfileId) {
         return;
     }
     if (!$this->entryDistributionId) {
         return;
     }
     $distributionProfile = DistributionProfilePeer::retrieveByPK($this->distributionProfileId);
     if (!$distributionProfile || $distributionProfile->getStatus() != DistributionProfileStatus::ENABLED) {
         return;
     }
     $this->distributionProfile = KalturaDistributionProfileFactory::createKalturaDistributionProfile($distributionProfile->getProviderType());
     $this->distributionProfile->fromObject($distributionProfile);
     $entryDistribution = EntryDistributionPeer::retrieveByPK($this->entryDistributionId);
     if ($entryDistribution) {
         $this->entryDistribution = new KalturaEntryDistribution();
         $this->entryDistribution->fromObject($entryDistribution);
     }
     $providerType = $sourceObject->getProviderType();
     if ($providerType) {
         if ($providerType == KalturaDistributionProviderType::GENERIC) {
             $this->providerData = new KalturaGenericDistributionJobProviderData($this);
         } else {
             $this->providerData = KalturaPluginManager::loadObject('KalturaDistributionJobProviderData', $providerType, array($this));
         }
         $providerData = $sourceObject->getProviderData();
         if ($this->providerData && $providerData && $providerData instanceof kDistributionJobProviderData) {
             $this->providerData->fromObject($providerData);
         }
     }
 }
 /**
  * Update Distribution Profile by id
  * 
  * @action update
  * @param int $id
  * @param KalturaDistributionProfile $distributionProfile
  * @return KalturaDistributionProfile
  * @throws ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND
  */
 function updateAction($id, KalturaDistributionProfile $distributionProfile)
 {
     $dbDistributionProfile = DistributionProfilePeer::retrieveByPK($id);
     if (!$dbDistributionProfile) {
         throw new KalturaAPIException(ContentDistributionErrors::DISTRIBUTION_PROFILE_NOT_FOUND, $id);
     }
     if ($distributionProfile->name !== null) {
         $distributionProfile->validatePropertyMinLength("name", 1);
     }
     $distributionProfile->toUpdatableObject($dbDistributionProfile);
     $dbDistributionProfile->save();
     $distributionProfile = KalturaDistributionProfileFactory::createKalturaDistributionProfile($dbDistributionProfile->getProviderType());
     $distributionProfile->fromObject($dbDistributionProfile);
     return $distributionProfile;
 }
 public function toObject($object = null, $skip = array())
 {
     if (is_null($object)) {
         $object = new PodcastDistributionProfile();
     }
     return parent::toObject($object, $skip);
 }
 protected function doFromObject($srcObj, KalturaDetachedResponseProfile $responseProfile = null)
 {
     parent::doFromObject($srcObj);
     $features = $srcObj->getExtendedFeatures();
     if (in_array(ObjectFeatureType::CATEGORY_ENTRIES, $features)) {
         $this->useCategoryEntries = true;
     }
 }
 public function toObject($object = null, $skip = array())
 {
     if (is_null($object)) {
         $object = new SyndicationDistributionProfile();
     }
     if (count(explode(",", $this->requiredFlavorParamsIds)) > 1) {
         throw new KalturaAPIException(KalturaErrors::INVALID_FIELD_VALUE, "requiredFlavorParamsIds");
     }
     return parent::toObject($object, $skip);
 }
 /**
  * Update Distribution Profile by id
  * 
  * @param int $id 
  * @param KalturaDistributionProfile $distributionProfile 
  * @return KalturaDistributionProfile
  */
 function update($id, KalturaDistributionProfile $distributionProfile)
 {
     $kparams = array();
     $this->client->addParam($kparams, "id", $id);
     $this->client->addParam($kparams, "distributionProfile", $distributionProfile->toParams());
     $this->client->queueServiceActionCall("contentdistribution_distributionprofile", "update", $kparams);
     if ($this->client->isMultiRequest()) {
         return $this->client->getMultiRequestResult();
     }
     $resultObject = $this->client->doQueue();
     $this->client->throwExceptionIfError($resultObject);
     $this->client->validateObjectType($resultObject, "KalturaDistributionProfile");
     return $resultObject;
 }
 public function fromObject($source_object)
 {
     parent::fromObject($source_object);
     $this->fieldConfigArray = KalturaDistributionFieldConfigArray::fromDbArray($source_object->getFieldConfigArray());
     $this->itemXpathsToExtend = KalturaStringArray::fromStringArray($source_object->getItemXpathsToExtend());
 }
 public function validateForInsert()
 {
     parent::validateForInsert();
     $this->validatePropertyNumeric('genericProviderId');
 }
 public function getMapBetweenObjects()
 {
     return array_merge(parent::getMapBetweenObjects(), self::$map_between_objects);
 }
 public function validateForInsert($propertiesToSkip = array())
 {
     parent::validateForInsert($propertiesToSkip);
     $this->validatePropertyNumeric('genericProviderId');
 }