当前位置: 首页>>代码示例>>PHP>>正文


PHP CList::insertAt方法代码示例

本文整理汇总了PHP中CList::insertAt方法的典型用法代码示例。如果您正苦于以下问题:PHP CList::insertAt方法的具体用法?PHP CList::insertAt怎么用?PHP CList::insertAt使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CList的用法示例。


在下文中一共展示了CList::insertAt方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: insertAt

 /**
  * Inserts an item at the specified position.
  * This method overrides the parent implementation by
  * checking the item to be inserted is of certain type.
  * @param integer $index the specified position.
  * @param mixed $item new item
  * @throws CException If the index specified exceeds the bound,
  * the list is read-only or the element is not of the expected type.
  */
 public function insertAt($index, $item)
 {
     if ($item instanceof $this->_type) {
         parent::insertAt($index, $item);
     } else {
         throw new CException(Yii::t('yii', 'CTypedList<{type}> can only hold objects of {type} class.', array('{type}' => $this->_type)));
     }
 }
开发者ID:azizbekvahidov,项目名称:foods,代码行数:17,代码来源:CTypedList.php

示例2: insertAt

 public function insertAt($index, $item)
 {
     if ($item instanceof IFilter) {
         parent::insertAt($index, $item);
     } else {
         throw new CException(Yii::t('yii', 'CFilterChain can only take objects implementing the IFilter interface.'));
     }
 }
开发者ID:smokeelow,项目名称:faicore,代码行数:8,代码来源:yiilite.php

示例3: testCanNotInsertWhenReadOnly

 public function testCanNotInsertWhenReadOnly()
 {
     $list = new CList(array(), true);
     $this->setExpectedException('CException');
     $list->insertAt(1, 2);
 }
开发者ID:kdambekalns,项目名称:framework-benchs,代码行数:6,代码来源:CListTest.php


注:本文中的CList::insertAt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。