Beispiel #1
0
 /**
  * Retrieve an audit trail object by id
  * 
  * @action get
  * @param int $id 
  * @return KalturaAuditTrail
  * @throws KalturaErrors::INVALID_OBJECT_ID
  */
 function getAction($id)
 {
     $dbAuditTrail = AuditTrailPeer::retrieveByPK($id);
     if (!$dbAuditTrail) {
         throw new KalturaAPIException(KalturaErrors::INVALID_OBJECT_ID, $id);
     }
     $auditTrail = new KalturaAuditTrail();
     $auditTrail->fromObject($dbAuditTrail, $this->getResponseProfile());
     return $auditTrail;
 }
 public function getListResponse(KalturaFilterPager $pager, KalturaDetachedResponseProfile $responseProfile = null)
 {
     $auditTrailFilter = $this->toObject();
     $c = new Criteria();
     $auditTrailFilter->attachToCriteria($c);
     $count = AuditTrailPeer::doCount($c);
     $pager->attachToCriteria($c);
     $list = AuditTrailPeer::doSelect($c);
     $response = new KalturaAuditTrailListResponse();
     $response->objects = KalturaAuditTrailArray::fromDbArray($list, $responseProfile);
     $response->totalCount = $count;
     return $response;
 }
Beispiel #3
0
 /**
  * @return int unique id per request
  */
 public function getUniqueRequestId()
 {
     if (!is_null(self::$uniqueRequestId)) {
         return self::$uniqueRequestId;
     }
     $dcId = kDataCenterMgr::getCurrentDcId();
     for ($i = 0; $i < 10; ++$i) {
         $requestId = $dcId . '_' . kString::generateStringId();
         $exists = AuditTrailPeer::retrieveByRequestId($requestId);
         if (!$exists) {
             self::$uniqueRequestId = $requestId;
             return self::$uniqueRequestId;
         }
     }
     throw new kAuditTrailException('Unable to generate unique id', kAuditTrailException::UNIQUE_ID_NOT_GENERATED);
 }
 public static function cleanMemory()
 {
     AuditTrailPeer::clearInstancePool();
     AuditTrailConfigPeer::clearInstancePool();
     //	    AuditTrailDataPeer::clearInstancePool();
 }
 public function getFieldNameFromPeer($field_name)
 {
     $res = AuditTrailPeer::translateFieldName($field_name, $this->field_name_translation_type, BasePeer::TYPE_COLNAME);
     return $res;
 }
 /**
  * Retrieve multiple objects by pkey.
  *
  * @param      array $pks List of primary keys
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByPKs($pks, PropelPDO $con = null)
 {
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria(AuditTrailPeer::DATABASE_NAME);
         $criteria->add(AuditTrailPeer::ID, $pks, Criteria::IN);
         $objs = AuditTrailPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Beispiel #7
0
 /**
  * Exports the object as an array.
  *
  * You can specify the key type of the array by passing one of the class
  * type constants.
  *
  * @param      string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
  *                        BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defaults to BasePeer::TYPE_PHPNAME.
  * @param      boolean $includeLazyLoadColumns (optional) Whether to include lazy loaded columns.  Defaults to TRUE.
  * @return     an associative array containing the field names (as keys) and field values
  */
 public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true)
 {
     $keys = AuditTrailPeer::getFieldNames($keyType);
     $result = array($keys[0] => $this->getId(), $keys[1] => $this->getCreatedAt(), $keys[2] => $this->getParsedAt(), $keys[3] => $this->getStatus(), $keys[4] => $this->getObjectType(), $keys[5] => $this->getObjectId(), $keys[6] => $this->getRelatedObjectId(), $keys[7] => $this->getRelatedObjectType(), $keys[8] => $this->getEntryId(), $keys[9] => $this->getMasterPartnerId(), $keys[10] => $this->getPartnerId(), $keys[11] => $this->getRequestId(), $keys[12] => $this->getKuserId(), $keys[13] => $this->getAction(), $keys[14] => $this->getData(), $keys[15] => $this->getKs(), $keys[16] => $this->getContext(), $keys[17] => $this->getEntryPoint(), $keys[18] => $this->getServerName(), $keys[19] => $this->getIpAddress(), $keys[20] => $this->getUserAgent(), $keys[21] => $this->getClientTag(), $keys[22] => $this->getDescription(), $keys[23] => $this->getErrorDescription());
     return $result;
 }
Beispiel #8
0
 /**
  * Retrieve multiple objects by request id.
  *
  * @param      string $requestId
  * @param      PropelPDO $con the connection to use
  * @throws     PropelException Any exceptions caught during processing will be
  *		 rethrown wrapped into a PropelException.
  */
 public static function retrieveByRequestId($requestId, PropelPDO $con = null)
 {
     $criteria = new Criteria();
     $criteria->add(AuditTrailPeer::REQUEST_ID, $requestId);
     return AuditTrailPeer::doSelect($criteria, $con);
 }
 /**
  * List audit trail objects by filter and pager
  * 
  * @action list
  * @param KalturaAuditTrailFilter $filter
  * @param KalturaFilterPager $pager
  * @return KalturaAuditTrailListResponse
  */
 function listAction(KalturaAuditTrailFilter $filter = null, KalturaFilterPager $pager = null)
 {
     if (!$filter) {
         $filter = new KalturaAuditTrailFilter();
     }
     $auditTrailFilter = $filter->toObject();
     $c = new Criteria();
     $auditTrailFilter->attachToCriteria($c);
     $count = AuditTrailPeer::doCount($c);
     if (!$pager) {
         $pager = new KalturaFilterPager();
     }
     $pager->attachToCriteria($c);
     $list = AuditTrailPeer::doSelect($c);
     $response = new KalturaAuditTrailListResponse();
     $response->objects = KalturaAuditTrailArray::fromDbArray($list);
     $response->totalCount = $count;
     return $response;
 }