本文整理匯總了PHP中false::getId方法的典型用法代碼示例。如果您正苦於以下問題:PHP false::getId方法的具體用法?PHP false::getId怎麽用?PHP false::getId使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類false
的用法示例。
在下文中一共展示了false::getId方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: buildFrontControlForTaxon
/**
* @param UnicatConfigurationManager $ucm
* @param TaxonModel|false $lastTaxon
*
* @throws \Exception
*/
protected function buildFrontControlForTaxon(UnicatConfigurationManager $ucm, $lastTaxon = false)
{
$this->node->addFrontControl('create_item')->setTitle('Добавить запись')->setUri($this->generateUrl('unicat_admin.item_create_in_taxon', ['configuration' => $ucm->getConfiguration()->getName(), 'default_taxon_id' => empty($lastTaxon) ? 0 : $lastTaxon->getId()]));
if (!empty($lastTaxon)) {
$this->node->addFrontControl('create_taxon')->setIsDefault(false)->setTitle('Создать Taxon')->setUri($this->generateUrl('unicat_admin.structure_with_parent_id', ['configuration' => $ucm->getConfiguration()->getName(), 'parent_id' => empty($lastTaxon) ? 0 : $lastTaxon->getId(), 'id' => $lastTaxon->getStructure()->getId()]));
$this->node->addFrontControl('edit_taxon')->setIsDefault(false)->setTitle('Редактировать Taxon')->setUri($this->generateUrl('unicat_admin.taxon', ['configuration' => $ucm->getConfiguration()->getName(), 'id' => $lastTaxon->getId(), 'structure_id' => $lastTaxon->getStructure()->getId()]));
}
$this->node->addFrontControl('manage_configuration')->setIsDefault(false)->setTitle('Управление каталогом')->setUri($this->generateUrl('unicat_admin.configuration', ['configuration' => $ucm->getConfiguration()->getName()]));
}
示例2: addMessage
/**
* @param string $text
* @param Mage_Customer_Model_Customer|Varien_Object|false $customer
* @param Mage_Admin_Model_User|false $user
* @param string $triggeredBy
* @param string $messageType
* @param bool|Mirasvit_Helpdesk_Model_Email $email
* @param bool|string $bodyFormat
*
* @return Mirasvit_Helpdesk_Model_Message
*
* @throws Exception
*/
public function addMessage($text, $customer, $user, $triggeredBy, $messageType = Mirasvit_Helpdesk_Model_Config::MESSAGE_PUBLIC, $email = false, $bodyFormat = false)
{
$message = Mage::getModel('helpdesk/message')->setTicketId($this->getId())->setType($messageType)->setBody($text)->setBodyFormat($bodyFormat)->setTriggeredBy($triggeredBy);
if ($triggeredBy == Mirasvit_Helpdesk_Model_Config::CUSTOMER) {
$message->setCustomerId($customer->getId());
$message->setCustomerName($customer->getName());
$message->setCustomerEmail($customer->getEmail());
$message->setIsRead(true);
$this->setLastReplyName($customer->getName());
} elseif ($triggeredBy == Mirasvit_Helpdesk_Model_Config::USER) {
$message->setUserId($user->getId());
if ($this->getOrigData('user_id') == $this->getData('user_id')) {
if ($messageType != Mirasvit_Helpdesk_Model_Config::MESSAGE_INTERNAL) {
$this->setUserId($user->getId());
// In case of different departments of ticket and owner, correct department id
$departments = Mage::getModel('helpdesk/department')->getCollection();
$departments->addUserFilter($user->getId())->addFieldToFilter('is_active', true);
if ($departments->count()) {
$this->_department = null;
$this->setDepartmentId($departments->getFirstItem()->getId());
}
}
}
$this->setLastReplyName($user->getName());
if ($message->isThirdParty()) {
$message->setThirdPartyEmail($this->getThirdPartyEmail());
}
} elseif ($triggeredBy == Mirasvit_Helpdesk_Model_Config::THIRD) {
$message->setThirdPartyEmail($this->getThirdPartyEmail());
if ($email) {
$this->setLastReplyName($email->getSenderNameOrEmail());
$message->setThirdPartyName($email->getSenderName());
}
}
if ($email) {
$message->setEmailId($email->getId());
}
//если тикет был закрыт, затем поступило сообщение от пользователя - мы его открываем
if ($triggeredBy != Mirasvit_Helpdesk_Model_Config::USER) {
if ($this->isClosed()) {
$status = Mage::getModel('helpdesk/status')->loadByCode(Mirasvit_Helpdesk_Model_Config::STATUS_OPEN);
$this->setStatusId($status->getId());
}
$this->setIsArchived(false);
}
$message->save();
if ($email) {
$email->setIsProcessed(true)->setAttachmentMessageId($message->getId())->save();
} else {
Mage::helper('helpdesk')->saveAttachments($message);
}
if (!$this->getIsSpam()) {
if ($this->getReplyCnt() == 0) {
Mage::helper('helpdesk/notification')->newTicket($this, $customer, $user, $triggeredBy, $messageType);
} else {
Mage::helper('helpdesk/notification')->newMessage($this, $customer, $user, $triggeredBy, $messageType);
}
}
$this->setReplyCnt($this->getReplyCnt() + 1);
if (!$this->getFirstReplyAt() && $user) {
$this->setFirstReplyAt(Mage::getSingleton('core/date')->gmtDate());
}
$this->setLastReplyAt(Mage::getSingleton('core/date')->gmtDate());
$this->save();
Mage::helper('helpdesk/history')->addMessage($this, $text, $triggeredBy, array('customer' => $customer, 'user' => $user, 'email' => $email), $messageType);
return $message;
}