Пример #1
0
 public function loadRelatedObjects(KalturaDetachedResponseProfile $responseProfile)
 {
     // trigger validation
     $responseProfile->toObject();
     if (!$responseProfile->relatedProfiles) {
         return;
     }
     $this->relatedObjects = new KalturaListResponseArray();
     foreach ($responseProfile->relatedProfiles as $relatedProfile) {
         /* @var $relatedProfile KalturaDetachedResponseProfile */
         if (!$relatedProfile->filter) {
             KalturaLog::notice("Related response-profile [{$relatedProfile->name}] has no filter and should not be used as nested profile");
             continue;
         }
         KalturaLog::debug("Loading related response-profile [{$relatedProfile->name}] with filter [" . get_class($relatedProfile->filter) . "]");
         $filter = clone $relatedProfile->filter;
         if ($relatedProfile->mappings) {
             $applied = true;
             foreach ($relatedProfile->mappings as $mapping) {
                 /* @var $mapping KalturaResponseProfileMapping */
                 if (!$mapping->apply($filter, $this)) {
                     $applied = false;
                     break;
                 }
             }
             if (!$applied) {
                 KalturaLog::warning("Mappings could not be applied for response-profile [{$relatedProfile->name}]");
                 continue;
             }
         } else {
             KalturaLog::debug("No mappings defined in response-profile [{$relatedProfile->name}]");
         }
         $pager = $relatedProfile->pager;
         if (!$pager) {
             $pager = new KalturaFilterPager();
         }
         $this->relatedObjects[$relatedProfile->name] = $filter->getListResponse($pager, $relatedProfile);
     }
 }
Пример #2
0
 public function toObject($object = null, $propertiesToSkip = array())
 {
     if (is_null($object)) {
         $object = new ResponseProfile();
     }
     if ($this->filter) {
         $object->setFilterApiClassName(get_class($this->filter));
         $object->setFilter($this->filter->toObject());
     }
     return parent::toObject($object, $propertiesToSkip);
 }
Пример #3
0
 public function toObject($object = null, $propertiesToSkip = array())
 {
     if (is_null($object)) {
         $object = new ResponseProfile();
     }
     return parent::toObject($object, $propertiesToSkip);
 }