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


PHP CList::toArray方法代碼示例

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


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

示例1: testOffsetUnset

 public function testOffsetUnset()
 {
     $list = new CList(array(1, 2, 3));
     $list->offsetUnset(1);
     $this->assertEquals(array(1, 3), $list->toArray());
 }
開發者ID:kdambekalns,項目名稱:framework-benchs,代碼行數:6,代碼來源:CListTest.php

示例2: getEavAttributes

 /**
  * @param array attributes key for get.
  * @return array
  */
 public function getEavAttributes($attributes = array())
 {
     // Get all attributes if not specified.
     if (empty($attributes)) {
         $attributes = $this->getSafeAttributesArray();
     }
     // Values array.
     $values = array();
     // Queue for load.
     $loadQueue = new CList();
     foreach ($attributes as $attribute) {
         // Check is safe.
         if ($this->hasSafeAttribute($attribute)) {
             $values[$attribute] = $this->attributes->itemAt($attribute);
             // If attribute not set and not load, prepare array for loaded.
             if (!$this->preload && $values[$attribute] === NULL) {
                 $loadQueue->add($attribute);
             }
         }
     }
     // If array for loaded not empty, load attributes.
     if (!$this->preload && $loadQueue->count() > 0) {
         $this->loadEavAttributes($loadQueue->toArray());
         foreach ($loadQueue as $attribute) {
             $values[$attribute] = $this->attributes->itemAt($attribute);
         }
     }
     // Delete load queue.
     unset($loadQueue);
     // Return values.
     return $values;
 }
開發者ID:buildshop,項目名稱:bs-common,代碼行數:36,代碼來源:EEavBehavior.php

示例3: actionIndex

 /**
  * Lists all models.
  */
 public function actionIndex()
 {
     $user = User::model()->findByAttributes(array("username" => Yii::app()->user->getId()));
     $meetingsId = new CList();
     $invitations = VCInvitation::model()->findAllByAttributes(array("invitee_id" => $user->id));
     foreach ($invitations as $inv) {
         $meetingsId->add($inv->videoconference_id);
     }
     $meetings = VideoConference::model()->findAllByAttributes(array("moderator_id" => $user->id));
     foreach ($meetings as $meeting) {
         $meetingsId->add($meeting->id);
     }
     //$dataProvider = new CActiveDataProvider('VideoConference');
     $this->render('index', array('meetingsId' => $meetingsId->toArray()));
 }
開發者ID:acuba001,項目名稱:Collaborative-Platform,代碼行數:18,代碼來源:VideoConferenceController.php


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