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


PHP ArrayObject::offsetUnset方法代码示例

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


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

示例1: unregisterObserver

 /**
  * @param Observer $observer
  */
 public function unregisterObserver(Observer $observer)
 {
     $key = array_search($observer, $this->observers->getArrayCopy(), true);
     if ($key) {
         $this->observers->offsetUnset($key);
     }
 }
开发者ID:pepin82,项目名称:patterns,代码行数:10,代码来源:Subject.php

示例2: clear

 /**
  * Clear datas with $uid key
  * @param mixed $uid
  * @return void
  */
 public function clear($uid = null)
 {
     $this->alloc();
     if ($uid) {
         return $this->session->offsetUnset($uid);
     }
     return $this->session->exchangeArray(array());
 }
开发者ID:cityware,项目名称:city-shared-memory,代码行数:13,代码来源:Session.php

示例3: remove

 public function remove(IcingaDoctrineQueryFilterChain $filter)
 {
     foreach ($this->filters as $fid => $checkFilter) {
         if ($checkFilter === $filter) {
             $this->filters->offsetUnset($fid);
             return true;
         }
     }
     return false;
 }
开发者ID:philippjenni,项目名称:icinga-web,代码行数:10,代码来源:IcingaDoctrineQueryFilterChain.class.php

示例4: offsetUnset

 public function offsetUnset($task)
 {
     $this->db->prepare($this->delete)->execute($task);
     if (parent::offsetExists($task)) {
         parent::offsetUnset($task);
     }
 }
开发者ID:cordoval,项目名称:todolist,代码行数:7,代码来源:TodoList.php

示例5: flushMessages

 /**
  * Get flash messages, and reset storage
  * @return array Messages to show for current request
  */
 public function flushMessages()
 {
     $messages = $this->storage->getArrayCopy();
     // clear storage items. will attempt to handle multiple types here as
     // it seems that some types prefer get_object_vars
     if ($this->storage instanceof \ArrayObject) {
         foreach (get_object_vars($this->storage) as $key => $value) {
             $this->storage->offsetUnset($key);
         }
     } else {
         foreach ($this->storage as $key => $value) {
             $this->storage->offsetUnset($key);
         }
     }
     return $messages;
 }
开发者ID:martynbiz,项目名称:php-flash-message,代码行数:20,代码来源:Flash.php

示例6: deleteConstant

 /**
  * Delete constant from constant list
  *
  * @param string $constant
  *
  * @return bool
  */
 public function deleteConstant($constant)
 {
     if (($index = array_search($constant, $this->constants->getArrayCopy())) !== false) {
         $this->constants->offsetUnset($index);
     }
     return $index !== false;
 }
开发者ID:zendframework,项目名称:zend-code,代码行数:14,代码来源:ValueGenerator.php

示例7: offsetUnset

 public function offsetUnset($index)
 {
     if ($this->offsetExists($index)) {
         parent::offsetUnset($index);
         $this->sync();
     }
 }
开发者ID:natxet,项目名称:operacore,代码行数:7,代码来源:Session.php

示例8: offsetUnset

 public function offsetUnset($name)
 {
     if ($this->offsetExists($name)) {
         $node = $this->offsetGet($name);
         $node->parentNode = null;
     }
     parent::offsetUnset($name);
 }
开发者ID:poef,项目名称:ariadne,代码行数:8,代码来源:NamedNodeList.php

示例9: offsetUnset

 public function offsetUnset($key)
 {
     if (isset($_SESSION[$key])) {
         unset($_SESSION[$key]);
         parent::offsetUnset($key);
     }
     return true;
 }
开发者ID:ephigenia,项目名称:ephframe,代码行数:8,代码来源:PHP.php

示例10: removeItemAt

/**
 *
 * Simple test comment.
 *
 * FANOUT := 3
 * CALLS  := 3
 *
 * @param ArrayAccess $items The input items.
 * @param integer     $index The requested index.
 *
 * @return void
 * @throws OutOfRangeException For invalid index values.
 */
function removeItemAt(ArrayObject $items, $index)
{
    if (is_int($index) === false) {
        throw new InvalidArgumentException('Error');
    }
    if (!$items->offsetExists($index)) {
        throw new OutOfRangeException('Error...');
    }
    $items->offsetUnset($index);
}
开发者ID:kingsj,项目名称:core,代码行数:23,代码来源:testAnalyzerCalculatesCorrectFunctionCoupling.php

示例11: remove

 /**
  * Removes an Object from Collection
  *
  * @param integer $index
  *   Offset to remove
  *
  * @return Next\Components\Iterator\AbstractCollection
  *   Collection Object (Fluent Interface)
  */
 public function remove($index)
 {
     $index = (int) $index;
     // If offset exists in Objects Collection and Objects References...
     if ($this->collection->offsetExists($index) && $this->references->offsetExists($index)) {
         // ... let's remove them
         $this->collection->offsetUnset($index);
         $this->references->offsetUnset($index);
     }
     return $this;
 }
开发者ID:nextframework,项目名称:next,代码行数:20,代码来源:AbstractCollection.php

示例12: skipWhileOf

 /**
  * 指定された条件が満たされる限り、シーケンスの要素をバイパスした後、残りの要素を返します。
  *
  * @param \ArrayObject $source 返される要素が含まれるシーケンス
  * @param \Closure $predicate 各要素が条件を満たしているかどうかをテストする関数
  *
  * @return \ArrayObject テストに初めて合格しない要素から入力シーケンスの最後の要素までのシーケンス
  */
 public function skipWhileOf(\ArrayObject $source, \Closure $predicate) : \ArrayObject
 {
     $skipped = new \ArrayObject($source->getArrayCopy());
     foreach ($source->getIterator() as $key => $value) {
         if ($predicate($value) === false) {
             break;
         }
         $skipped->offsetUnset($key);
     }
     return new \ArrayObject(array_values($skipped->getArrayCopy()));
 }
开发者ID:yukar-php,项目名称:linq,代码行数:19,代码来源:TExtract.php

示例13: remove

 /**
  * Removes the first occurrence of the specified element.
  * @param  mixed
  * @return bool  true if this collection changed as a result of the call
  * @throws NotSupportedException
  */
 public function remove($item)
 {
     $this->updating();
     $index = $this->search($item);
     if ($index === FALSE) {
         return FALSE;
     } else {
         parent::offsetUnset($index);
         return TRUE;
     }
 }
开发者ID:romcok,项目名称:treeview,代码行数:17,代码来源:Collection.php

示例14: setProperties

 private function setProperties($_class)
 {
     # armazena a classe principal
     // $class->getProperties(): recupera lista de atributos da classe
     foreach ($this->reflection->getProperties() as $attributes) {
         # recupera os comentários dos atributos
         $doc = $attributes->getDocComment();
         $doc = str_replace("/**", "", $doc);
         $doc = str_replace("*/", "", $doc);
         # gera um array de comentários
         $doc = explode('*', $doc);
         # cria um array com a classe ArrayObject
         $doc = new \ArrayObject($doc);
         # retira o primeiro elemento vazio do array
         $doc->offsetUnset(0);
         # análise do array de documentação
         foreach ($doc as $vDoc) {
             # identifica o atributo da classe vinculada
             if (strstr($vDoc, "@class")) {
                 $var = explode("@class", $vDoc);
                 # $this->class = trim ( $var[1] );
                 $_class = trim($var[1]);
             }
             # identifica o atributo primary key
             if (strstr($vDoc, "@pk")) {
                 $this->pk = $attributes->getName();
             }
             # identifica o atributo foreign key
             if (strstr($vDoc, "@fk")) {
                 $this->fk[] = $attributes->getName();
             }
             # identifica uma classe referenciada de relacionamento M x N
             if (strstr($vDoc, "@referencedTable")) {
                 $this->referencedTable[] = $attributes->getName();
             }
             # ---------------------------------------------
             # INSERIR NOVAS REGRAS AQUI
             # ---------------------------------------------
         }
         $this->classes[$_class] = $_class;
         if ($this->classePrincipal == $_class) {
             # armazena as propriedades da classe principal
             $this->properties[$this->classePrincipal][] = $attributes->getName();
         } else {
             # armazena as propriedades da classe derivada
             $this->properties[$_class] = $attributes->getName();
         }
         # $_class recebe seu valor original
         $_class = $this->classePrincipal;
     }
     // fim do foreach
     $this->properties;
 }
开发者ID:elsonvinicius,项目名称:framework,代码行数:53,代码来源:phpDoc.class---.php

示例15: _parseArguments

 /**
  * Parses the given arguments
  * 
  * @return void
  * @throws Brawler_Console_Exception
  */
 public static function _parseArguments()
 {
     self::$_arguments = new Brawler_Console_Argument_List();
     $args = new ArrayObject($_SERVER['argv']);
     $args->offsetUnset(0);
     $i = $args->getIterator();
     while ($i->valid()) {
         if (substr($i->current(), 0, 1) == '-') {
             // parse argument
             self::_parseArgument($i->current());
         } else {
             // invalid call
             throw new Brawler_Console_Exception('Invalid call');
         }
         $i->next();
     }
 }
开发者ID:googlecode-mirror,项目名称:brawler,代码行数:23,代码来源:Console.php


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