本文整理汇总了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;
}