本文整理汇总了PHP中Registry::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Registry::remove方法的具体用法?PHP Registry::remove怎么用?PHP Registry::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registry
的用法示例。
在下文中一共展示了Registry::remove方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: removeOperation
/**
* @param $id
*/
public function removeOperation($id)
{
try {
$operation = $this->getNewsItemByOperation($id);
$this->em->remove($operation);
$this->em->flush();
} catch (\Exception $e) {
}
}
示例2: testRemove
public function testRemove()
{
Registry::set('a', 'a');
Registry::set('b', 'b');
Registry::remove('b');
$this->assertEquals(true, Registry::isValidKey('a'));
$this->assertEquals(false, Registry::isValidKey('b'));
}
示例3: cleanUpUnassignedTokens
/**
* Removes the not assigned tokens.
*
* @param Token[] $tokens
*/
public function cleanUpUnassignedTokens(array $tokens)
{
$this->em->clear();
foreach ($tokens as $token) {
$token = $this->em->merge($token);
$this->em->remove($token);
}
$this->em->flush();
}
示例4: testDelElement
function testDelElement()
{
$reg = new Registry();
$element = array("numbers" => array(1, 2, 3, 4, 5), "letters" => array("a", "b", "c", "..."));
$element2 = array("foo" => "bar");
$reg->add($element);
$reg->add($element2);
$count = $reg->elementCount();
$reg->remove($element);
$count2 = $reg->elementCount();
print "Test delete Element\n";
var_dump($count);
var_dump($count2);
var_dump($reg);
}