getType() 공개 메소드

Return the data type represented by this object.
public getType ( ) : string
리턴 string The type of data this instance handles.
예제 #1
0
 /**
  * Generate a prefix for the History system for the given Kolab data.
  *
  * @param  Horde_Kolab_Storage_Data $data  The data object.
  *
  * @return string  The History prefix.
  */
 public static function getPrefix(Horde_Kolab_Storage_Data $data)
 {
     $app = self::_type2app($data->getType());
     if (empty($app)) {
         Horde::log(sprintf('Unsupported app type: %s', $data->getType()), 'WARN');
         return false;
     }
     // Determine share id
     $user = $data->getAuth();
     $folder = $data->getPath();
     $share_id = '';
     $all_shares = $GLOBALS['injector']->getInstance('Horde_Core_Factory_Share')->create($app)->listAllShares();
     foreach ($all_shares as $id => $share) {
         if ($folder == $share->get('folder')) {
             $share_id = $id;
             break;
         }
     }
     // Bail out if we are unable to determine the share id.
     if (empty($share_id)) {
         Horde::log(sprintf('HISTORY: share_id not found. Can\'t compute history prefix for user: %s, folder: %s', $user, $folder), 'WARN');
         return false;
     }
     return $app . ':' . $share_id . ':';
 }
예제 #2
0
파일: Log.php 프로젝트: horde/horde
 /**
  * Return the data type represented by this object.
  *
  * @return string The type of data this instance handles.
  */
 public function getType()
 {
     return $this->_data->getType();
 }
예제 #3
0
파일: Base.php 프로젝트: raz0rsdge/horde
 /**
  * Add the set of data queries.
  *
  * @param Horde_Kolab_Storage_Data $data   The data.
  * @param array                    $params Additional query parameters.
  *
  * @return NULL
  */
 public function addDataQuerySet(Horde_Kolab_Storage_Data $data, $params = array())
 {
     foreach ($this->_data_queries as $query => $type) {
         if ($type === true || $type == $data->getType()) {
             $this->_addDataQuery($data, $query, $params);
         }
     }
 }
예제 #4
0
 /**
  * Generate a prefix for the History system for the given Kolab data.
  *
  * @param  Horde_Kolab_Storage_Data $data  The data object.
  *
  * @return string  The History prefix.
  */
 public static function getPrefix(Horde_Kolab_Storage_Data $data)
 {
     $app = empty(self::$_map[$data->getType()]) ? false : self::$_map[$data->getType()];
     return empty($app) ? false : sprintf('%s:internal_id:', $app);
 }