當前位置: 首頁>>代碼示例>>PHP>>正文


PHP xPDOSimpleObject::toArray方法代碼示例

本文整理匯總了PHP中xPDOSimpleObject::toArray方法的典型用法代碼示例。如果您正苦於以下問題:PHP xPDOSimpleObject::toArray方法的具體用法?PHP xPDOSimpleObject::toArray怎麽用?PHP xPDOSimpleObject::toArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在xPDOSimpleObject的用法示例。


在下文中一共展示了xPDOSimpleObject::toArray方法的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: toArray

 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if (!empty($this->xpdo->lexicon) && $this->xpdo->lexicon instanceof modLexicon) {
         if ($this->get('lexicon') != 'core:dashboards') {
             $this->xpdo->lexicon->load($this->get('lexicon'));
         }
         $array['name_trans'] = $this->xpdo->lexicon->exists($this->get('name')) ? $this->xpdo->lexicon($this->get('name')) : $this->get('name');
         $array['description_trans'] = $this->xpdo->lexicon->exists($this->get('description')) ? $this->xpdo->lexicon($this->get('description')) : $this->get('description');
     }
     return $array;
 }
開發者ID:ChrstnMgcn,項目名稱:revolution,代碼行數:12,代碼來源:moddashboardwidget.class.php

示例2: toArray

 /**
  * {inheritdoc}
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $arr = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     // figure out the icon
     $icon = $this->getIcon();
     if (!empty($icon) && is_array($icon)) {
         switch ($icon['type']) {
             case 'custom':
                 $arr['iconcls'] = '';
                 $arr['iconpath'] = $icon['value'];
                 break;
             case 'preset':
             default:
                 $arr['iconcls'] = $icon['value'];
                 $arr['iconpath'] = '';
                 break;
         }
     }
     return $arr;
 }
開發者ID:Realetive,項目名稱:QuickstartButtons,代碼行數:28,代碼來源:qsbbutton.class.php

示例3: toArray

 /**
  * Override toArray to provide more values
  *
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     if ($this->xpdo->context->key != 'mgr' && $this->xpdo->discuss) {
         $values['url'] = $this->getUrl();
     }
     return $values;
 }
開發者ID:oneismore,項目名稱:Discuss,代碼行數:17,代碼來源:disboard.class.php

示例4: toArray

 /**
  * Override toArray to provide more values
  * 
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $values = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $values[$keyPrefix . 'age'] = $this->get('age');
     $values[$keyPrefix . 'gender_formatted'] = $this->get('gender_formatted');
     $values[$keyPrefix . 'avatarUrl'] = $this->getAvatarUrl();
     $values[$keyPrefix . 'isSelf'] = $this->xpdo->user->get('id') == $this->get('user');
     $values[$keyPrefix . 'canEdit'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canAccount'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'canMerge'] = $values[$keyPrefix . 'isSelf'];
     $values[$keyPrefix . 'name'] = $this->get('name');
     $values[$keyPrefix . 'posts_formatted'] = $this->get('posts_formatted');
     return $values;
 }
開發者ID:oneismore,項目名稱:Discuss,代碼行數:23,代碼來源:disuser.class.php

示例5: toArray

 /**
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = strip_tags($v, '<span>');
             $v = preg_replace('@\\[\\[(.[^\\[\\[]*?)\\]\\]@si', '', $v);
             $v = html_entity_decode($v, ENT_COMPAT, 'UTF-8');
         }
     }
     reset($array);
     return $array;
 }
開發者ID:oneismore,項目名稱:Discuss,代碼行數:20,代碼來源:disthread.class.php

示例6: toArray

 /**
  * Always ensure that the title strips any HTML/MODX tags
  * @param string $keyPrefix
  * @param bool $rawValues
  * @param bool $excludeLazy
  * @param bool $includeRelated
  * @return array
  */
 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy);
     foreach ($array as $k => &$v) {
         if ($k == 'title') {
             $v = $this->xpdo->discuss->stripAllTags($v);
         }
     }
     reset($array);
     return $array;
 }
開發者ID:oneismore,項目名稱:Discuss,代碼行數:19,代碼來源:dispost.class.php

示例7: toArray

 public function toArray($keyPrefix = '', $rawValues = false, $excludeLazy = false, $includeRelated = false)
 {
     $array = parent::toArray($keyPrefix, $rawValues, $excludeLazy, $includeRelated);
     $array['badge'] = $this->getBadge();
     return $array;
 }
開發者ID:oneismore,項目名稱:Discuss,代碼行數:6,代碼來源:disusergroupprofile.class.php


注:本文中的xPDOSimpleObject::toArray方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。