本文整理汇总了PHP中RedBeanPHP\Facade::dispenseLabels方法的典型用法代码示例。如果您正苦于以下问题:PHP Facade::dispenseLabels方法的具体用法?PHP Facade::dispenseLabels怎么用?PHP Facade::dispenseLabels使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类RedBeanPHP\Facade
的用法示例。
在下文中一共展示了Facade::dispenseLabels方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testLabels
/**
* Test basic labels.
*
* @return void
*/
public function testLabels()
{
testpack('Test Labels');
$meals = R::dispenseLabels('meal', array('meat', 'fish', 'vegetarian'));
asrt(is_array($meals), TRUE);
asrt(count($meals), 3);
foreach ($meals as $m) {
asrt($m instanceof OODBBean, TRUE);
}
$listOfMeals = implode(',', R::gatherLabels($meals));
asrt($listOfMeals, 'fish,meat,vegetarian');
}
示例2: testMultiDeleteUpdate
/**
* Test trashAll().
*/
public function testMultiDeleteUpdate()
{
testpack('test multi delete and multi update');
$beans = R::dispenseLabels('bean', array('a', 'b'));
$ids = R::storeAll($beans);
asrt((int) R::count('bean'), 2);
R::trashAll(R::batch('bean', $ids));
asrt((int) R::count('bean'), 0);
testpack('test assocManager check');
$rb = new OODB(R::getWriter());
try {
$rb->getAssociationManager();
fail();
} catch (RedException $e) {
pass();
}
}