本文整理匯總了PHP中collection::get_label方法的典型用法代碼示例。如果您正苦於以下問題:PHP collection::get_label方法的具體用法?PHP collection::get_label怎麽用?PHP collection::get_label使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類collection
的用法示例。
在下文中一共展示了collection::get_label方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testSet_label
public function testSet_label()
{
self::$object->set_name('pretty name');
self::$object->set_label('fr', 'french label');
self::$object->set_label('en', 'english label');
self::$object->set_label('nl', null);
self::$object->set_label('de', null);
$this->assertEquals('french label', self::$object->get_label('fr'));
$this->assertEquals('english label', self::$object->get_label('en'));
$this->assertEquals('pretty name', self::$object->get_label('nl'));
$this->assertEquals('pretty name', self::$object->get_label('de'));
$this->assertNull(self::$object->get_label('nl', false));
$this->assertNull(self::$object->get_label('de', false));
}
示例2: list_collection
/**
* Retrieve detailled informations about one collection
*
* @param collection $collection
*
* @return array
*/
private function list_collection(\collection $collection)
{
return ['base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), 'name' => $collection->get_name(), 'labels' => ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl')], 'record_amount' => $collection->get_record_amount()];
}
示例3: getCollectionSummary
private function getCollectionSummary(\collection $collection, $userData)
{
return ['coll-name' => $collection->get_label($this->locale), 'can-register' => $collection->isRegistrationEnabled(), 'cgu' => $collection->getTermsOfUse(), 'registration' => $this->userHasRequestedARegistrationOnCollection($collection, $userData)];
}
示例4: list_collection
/**
* Retrieve detailled informations about one collection
*
* @param collection $collection
* @return array
*/
protected function list_collection(collection $collection)
{
$ret = ['base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), 'name' => $collection->get_name(), 'labels' => ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl')], 'record_amount' => $collection->get_record_amount()];
return $ret;
}