public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null) { $permissionFilter = $this->toObject(); $c = new Criteria(); $permissionFilter->attachToCriteria($c); $count = PermissionPeer::doCount($c); $pager->attachToCriteria($c); $list = PermissionPeer::doSelect($c); $response = new KalturaPermissionListResponse(); $response->objects = KalturaPermissionArray::fromDbArray($list, $responseProfile); $response->totalCount = $count; return $response; }
/** * Lists permission objects that are associated with an account. * Blocked permissions are listed unless you use a filter to exclude them. * Blocked permissions are listed unless you use a filter to exclude them. * * @action list * @param KalturaPermissionFilter $filter A filter used to exclude specific types of permissions * @param KalturaFilterPager $pager A limit for the number of records to display on a page * @return KalturaPermissionListResponse The list of permission objects */ public function listAction(KalturaPermissionFilter $filter = null, KalturaFilterPager $pager = null) { if (!$filter) { $filter = new KalturaPermissionFilter(); } $permissionFilter = $filter->toObject(); $c = new Criteria(); $permissionFilter->attachToCriteria($c); $count = PermissionPeer::doCount($c); if (!$pager) { $pager = new KalturaFilterPager(); } $pager->attachToCriteria($c); $list = PermissionPeer::doSelect($c); $response = new KalturaPermissionListResponse(); $response->objects = KalturaPermissionArray::fromDbArray($list); $response->totalCount = $count; return $response; }
public function doFromObject($source_object, KalturaDetachedResponseProfile $responseProfile = null) { parent::doFromObject($source_object, $responseProfile); $permissions = PermissionPeer::retrievePartnerLevelPermissions($source_object->getId()); $this->permissions = KalturaPermissionArray::fromDbArray($permissions); $this->limits = KalturaSystemPartnerLimitArray::fromPartner($source_object); $this->restrictEntryByMetadata = $source_object->getShouldApplyAccessControlOnEntryMetadata(); $dbAutoModerationEntryFilter = $source_object->getAutoModerateEntryFilter(); if ($dbAutoModerationEntryFilter) { $this->autoModerateEntryFilter = new KalturaBaseEntryFilter(); $this->autoModerateEntryFilter->fromObject($dbAutoModerationEntryFilter); } $this->partnerName = kString::stripUtf8InvalidChars($this->partnerName); $this->description = kString::stripUtf8InvalidChars($this->description); $this->adminName = kString::stripUtf8InvalidChars($this->adminName); if ($this->deliveryProfileIds) { $this->deliveryProfileIds = json_encode($this->deliveryProfileIds); } }
public function fromObject($source_object) { parent::fromObject($source_object); $permissions = PermissionPeer::retrievePartnerLevelPermissions($source_object->getId()); $this->permissions = KalturaPermissionArray::fromDbArray($permissions); $this->limits = KalturaSystemPartnerLimitArray::fromPartner($source_object); $dbAutoModerationEntryFilter = $source_object->getAutoModerateEntryFilter(); if ($dbAutoModerationEntryFilter) { $this->autoModerateEntryFilter = new KalturaBaseEntryFilter(); $this->autoModerateEntryFilter->fromObject($dbAutoModerationEntryFilter); } $this->partnerName = kString::stripUtf8InvalidChars($this->partnerName); $this->description = kString::stripUtf8InvalidChars($this->description); $this->adminName = kString::stripUtf8InvalidChars($this->adminName); }