本文整理汇总了PHP中ContactsUtil::getStartingStateId方法的典型用法代码示例。如果您正苦于以下问题:PHP ContactsUtil::getStartingStateId方法的具体用法?PHP ContactsUtil::getStartingStateId怎么用?PHP ContactsUtil::getStartingStateId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContactsUtil
的用法示例。
在下文中一共展示了ContactsUtil::getStartingStateId方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testContactsUtilSetStartingStateByOrder
public function testContactsUtilSetStartingStateByOrder()
{
$startingStateId = ContactsUtil::getStartingStateId();
$startingState = ContactState::getById($startingStateId);
$startingState->delete();
$this->assertEquals(6, count(ContactState::GetAll()));
ContactsUtil::setStartingStateByOrder(2);
$startingStateId = ContactsUtil::getStartingStateId();
$states = ContactState::getAll('order');
$this->assertEquals($states[1]->id, $startingStateId);
$startingState = ContactState::getByName('Recycled');
$this->assertEquals(1, count($startingState));
$this->assertEquals($startingState[0]->id, $startingStateId);
}
示例2: getLeadStateDataFromStartingStateLabelByLanguage
/**
* Get an array of states from the starting state onwards, id/translated label pairings of the
* existing contact states ordered by order.
* @param string $language
* @return array
*/
public static function getLeadStateDataFromStartingStateLabelByLanguage($language)
{
assert('is_string($language)');
$leadStatesData = array();
$states = ContactState::getAll('order');
$startingState = ContactsUtil::getStartingStateId();
foreach ($states as $state) {
if ($startingState == $state->id) {
break;
}
$state->name = ContactsUtil::resolveStateLabelByLanguage($state, $language);
$leadStatesData[] = $state;
}
return $leadStatesData;
}
示例3: testIsStateALeadByStateName
public function testIsStateALeadByStateName()
{
$allContactStates = ContactState::GetAll();
$this->assertGreaterThan(1, count($allContactStates));
foreach ($allContactStates as $contactState) {
if ($contactState->id < ContactsUtil::getStartingStateId()) {
$isStateALeadByStateNameCorrect = true;
} else {
$isStateALeadByStateNameCorrect = false;
}
$isStateALead = LeadsUtil::isStateALeadByStateName($contactState->name);
$this->assertEquals($isStateALead, $isStateALeadByStateNameCorrect);
}
}