當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。