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


PHP Set::remove方法代码示例

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


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

示例1: delete

 /**
  * Delete value from the session
  *
  * @param string $key The key to be deleted
  * @param array $options Options array. Not used for this adapter method.
  * @return closure Function returning boolean `true` if the key no longer exists
  *         in the session, `false` otherwise
  */
 public static function delete($key, array $options = array())
 {
     if (!static::isStarted() && !static::_start()) {
         throw new RuntimeException("Could not start session.");
     }
     $class = __CLASS__;
     return function ($self, $params) use($class) {
         $key = $params['key'];
         $class::overwrite($_SESSION, Set::remove($_SESSION, $key));
         return !Set::check($_SESSION, $key);
     };
 }
开发者ID:WarToaster,项目名称:HangOn,代码行数:20,代码来源:Php.php

示例2: delete

 /**
  * Delete value from the session
  *
  * @param string $key The key to be deleted
  * @param array $options Options array. Not used for this adapter method.
  * @return closure Function returning boolean `true` if the key no longer exists
  *		   in the session, `false` otherwise
  */
 public function delete($key, array $options = array())
 {
     if (!$this->isStarted() && $this->_startup() === false) {
         throw new RuntimeException("Could not start session");
     }
     $class = get_called_class();
     return function ($self, $params) use($class) {
         if (!isset($_SESSION)) {
             return false;
         }
         $key = $params['key'];
         $class::overwrite($_SESSION, Set::remove($_SESSION, $key));
         return !Set::check($_SESSION, $key);
     };
 }
开发者ID:mariano,项目名称:li3_doctrine2,代码行数:23,代码来源:Entity.php

示例3: testInsertAndRemoveWithFunkyKeys

	public function testInsertAndRemoveWithFunkyKeys() {
		$set = Set::insert(array(), 'Session Test', "test");
		$result = Set::extract($set, '/Session Test');
		$this->assertEqual($result, array('test'));

		$set = Set::remove($set, 'Session Test');
		$this->assertFalse(Set::check($set, 'Session Test'));

		$this->assertTrue($set = Set::insert(array(), 'Session Test.Test Case', "test"));
		$this->assertTrue(Set::check($set, 'Session Test.Test Case'));
	}
开发者ID:niel,项目名称:lithium,代码行数:11,代码来源:SetTest.php

示例4: delete

 /**
  * Delete value from the session
  *
  * @param string $key The key to be deleted.
  * @param array $options Options array. Not used for this adapter method.
  * @return \Closure Function returning boolean `true` if the key no longer
  *         exists in the session, `false` otherwise
  */
 public function delete($key, array $options = array())
 {
     if (!$this->isStarted() && !$this->_start()) {
         throw new RuntimeException('Could not start session.');
     }
     $self = $this;
     return function ($class, $params) use($self) {
         $key = $params['key'];
         $self->overwrite($_SESSION, Set::remove($_SESSION, $key));
         return !Set::check($_SESSION, $key);
     };
 }
开发者ID:fedeisas,项目名称:lithium,代码行数:20,代码来源:Php.php


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