本文整理汇总了PHP中CustomFieldData::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP CustomFieldData::getAll方法的具体用法?PHP CustomFieldData::getAll怎么用?PHP CustomFieldData::getAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CustomFieldData
的用法示例。
在下文中一共展示了CustomFieldData::getAll方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: processList
protected function processList($params)
{
$customFieldDataItems = CustomFieldData::getAll();
$data = array();
foreach ($customFieldDataItems as $customFieldDataItem) {
$dataAndLabels = CustomFieldDataUtil::getDataIndexedByDataAndTranslatedLabelsByLanguage($customFieldDataItem, Yii::app()->language);
$data[$customFieldDataItem->name] = $dataAndLabels;
}
$result = new ApiResult(ApiResponse::STATUS_SUCCESS, $data, null, null);
return $result;
}
示例2: testListCustomFieldData
public function testListCustomFieldData()
{
Yii::app()->user->userModel = User::getByUsername('super');
$authenticationData = $this->login();
$headers = array('Accept: application/json', 'ZURMO_SESSION_ID: ' . $authenticationData['sessionId'], 'ZURMO_TOKEN: ' . $authenticationData['token'], 'ZURMO_API_REQUEST_TYPE: REST');
$industryValues = array('Automotive', 'Adult Entertainment', 'Financial Services', 'Mercenaries & Armaments');
$industryFieldData = CustomFieldData::getByName('Industries');
$industryFieldData->serializedData = serialize($industryValues);
$this->assertTrue($industryFieldData->save());
$customFieldDataItems = CustomFieldData::getAll();
$compareData = array();
foreach ($customFieldDataItems as $customFieldDataItem) {
$dataAndLabels = CustomFieldDataUtil::getDataIndexedByDataAndTranslatedLabelsByLanguage($customFieldDataItem, 'en');
$compareData[$customFieldDataItem->name] = $dataAndLabels;
}
//Test List
$response = $this->createApiCallWithRelativeUrl('list/', 'GET', $headers);
$response = json_decode($response, true);
$this->assertEquals(ApiResponse::STATUS_SUCCESS, $response['status']);
$this->assertEquals($compareData, $response['data']);
}