本文整理匯總了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);
}