public function toObject($object_to_fill = null, $props_to_skip = array()) { if (!$object_to_fill) { $object_to_fill = new EntryCuePointSearchFilter(); } return parent::toObject($object_to_fill, $props_to_skip); }
public function toObject($objectToFill = null, $propsToSkip = array()) { if (is_null($objectToFill)) { $objectToFill = new AdvancedSearchFilterAttributeCondition(); } return parent::toObject($objectToFill, $propsToSkip); }
public function toObject($object_to_fill = null, $props_to_skip = array()) { if (!$object_to_fill) { $object_to_fill = new kIndexAdvancedFilter(); } return parent::toObject($object_to_fill, $props_to_skip); }
public function toObject($object_to_fill = null, $props_to_skip = array()) { if (is_null($object_to_fill)) { $object_to_fill = new AdvancedSearchFilterCondition(); } return parent::toObject($object_to_fill, $props_to_skip); }
public function toObject($objectToFill = null, $propsToSkip = array()) { KalturaLog::debug("To object: Value [{$this->value}]"); if (is_null($objectToFill)) { $objectToFill = new AdvancedSearchFilterAttributeCondition(); } return parent::toObject($objectToFill, $propsToSkip); }
public function toObject($object_to_fill = null, $props_to_skip = array()) { KalturaLog::debug("To object: field [{$this->field}] value [{$this->value}]"); if (is_null($object_to_fill)) { $object_to_fill = new AdvancedSearchFilterCondition(); } return parent::toObject($object_to_fill, $props_to_skip); }
public function toObject($object_to_fill = null, $props_to_skip = array()) { // translate the order by properties $newOrderBy = ""; $orderByMap = $this->getOrderByMap(); if ($orderByMap) { $orderProps = explode(",", $this->orderBy); foreach ($orderProps as $prop) { if (isset($orderByMap[$prop])) { $newOrderBy .= $orderByMap[$prop] . ","; } } } if (strpos($newOrderBy, ",") === strlen($newOrderBy) - 1) { $newOrderBy = substr($newOrderBy, 0, strlen($newOrderBy) - 1); } $this->orderBy = $newOrderBy; $typeReflector = KalturaTypeReflectorCacher::get(get_class($this)); foreach ($this->getMapBetweenObjects() as $this_prop => $object_prop) { if (is_numeric($this_prop)) { $this_prop = $object_prop; } $value = $this->{$this_prop}; $propertyInfo = $typeReflector->getProperty($this_prop); if (!$propertyInfo) { KalturaLog::alert("Cannot load property info for attribute [{$this_prop}] in object [" . get_class($this) . "] try delete the cache"); continue; } if ($propertyInfo->isDynamicEnum()) { $propertyType = $propertyInfo->getType(); $enumType = call_user_func(array($propertyType, 'getEnumClass')); $value = kPluginableEnumsManager::apiToCore($enumType, $value); } elseif ($propertyInfo->getDynamicType()) { $propertyType = $propertyInfo->getDynamicType(); $enumType = call_user_func(array($propertyType, 'getEnumClass')); $values = explode(',', $value); $finalValues = array(); foreach ($values as $val) { $finalValues[] = kPluginableEnumsManager::apiToCore($enumType, $val); } $value = implode(',', $finalValues); } // convert the v3 prop name to the naming convension of the core filter $filter_prop_name = self::translatePropNames($object_prop); $object_to_fill->set($filter_prop_name, $value); } if (is_object($this->advancedSearch)) { KalturaLog::debug("Advanced Search [" . print_r($this->advancedSearch, true) . "]"); if ($this->advancedSearch instanceof KalturaSearchItem) { $advancedSearch = $this->advancedSearch->toObject(); if ($advancedSearch) { $object_to_fill->setAdvancedSearch($advancedSearch); } } } return $object_to_fill; }
public function toObject($object_to_fill = null, $props_to_skip = array()) { if (!$object_to_fill) { $object_to_fill = new AdvancedSearchFilterOperator(); } $object_to_fill = parent::toObject($object_to_fill, $props_to_skip); if ($this->items) { $object_to_fill->setItems($this->items->toObjectsArray()); } return $object_to_fill; }
public function toObject($object_to_fill = null, $props_to_skip = array()) { if (!$object_to_fill) { $object_to_fill = new ContentDistributionSearchFilter(); } $object = parent::toObject($object_to_fill, $props_to_skip); if ($this->entryDistributionValidationErrors) { $object->setEntryDistributionValidationErrors(explode(',', $this->entryDistributionValidationErrors)); } return $object; }
public function toObject($object_to_fill = null, $props_to_skip = array()) { // KalturaLog::debug("To object: type [$this->type] items [" . count($this->items) . "]"); if (!$object_to_fill) { $object_to_fill = new AdvancedSearchFilterOperator(); } $object_to_fill = parent::toObject($object_to_fill, $props_to_skip); if ($this->items) { $object_to_fill->setItems($this->items->toObjectsArray()); } return $object_to_fill; }
public function toObject($obj = null, $props_to_skip = array()) { if (!$obj) { $obj = new kCategoryKuserAdvancedFilter(); } if (!$this->memberIdEq && !$this->memberIdIn) { throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'memberIdEq,memberIdIn'); } if (!$this->memberPermissionsMatchOr && !$this->memberPermissionsMatchAnd) { throw new KalturaAPIException(KalturaErrors::PROPERTY_VALIDATION_CANNOT_BE_NULL, 'memberIdEq,memberIdIn'); } if ($this->memberIdEq) { $kuser = kuserPeer::getKuserByPartnerAndUid(kCurrentContext::getCurrentPartnerId(), $this->memberIdEq); if (!$kuser) { throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND); } $kuserIds = array($kuser->getId()); // retrieve categories that the user is a member by a group. $kgroupIds = KuserKgroupPeer::retrieveKgroupIdsByKuserId($kuser->getId()); if (!is_null($kgroupIds) && is_array($kgroupIds)) { $kuserIds = array_merge($kgroupIds, $kuserIds); } $obj->setMemberIdIn($kuserIds); } if ($this->memberIdIn) { $kusers = kuserPeer::getKuserByPartnerAndUids(kCurrentContext::getCurrentPartnerId(), explode(',', $this->memberIdIn)); $kuserIds = array(); if (!$kusers || !count($kusers)) { throw new KalturaAPIException(KalturaErrors::USER_NOT_FOUND); } foreach ($kusers as $kuser) { $kuserIds[] = $kuser->getId(); } // retrieve categories that the users are members by a group. $kgroupIds = KuserKgroupPeer::retrieveKgroupIdsByKuserIds($kuserIds); if (!is_null($kgroupIds) && is_array($kgroupIds)) { $kuserIds = array_merge($kgroupIds, $kuserIds); } $obj->setMemberIdIn($kuserIds); } return parent::toObject($obj, $props_to_skip); }