當前位置: 首頁>>代碼示例>>PHP>>正文


PHP false::getName方法代碼示例

本文整理匯總了PHP中false::getName方法的典型用法代碼示例。如果您正苦於以下問題:PHP false::getName方法的具體用法?PHP false::getName怎麽用?PHP false::getName使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在false的用法示例。


在下文中一共展示了false::getName方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: handleUpload

 /**
  * Returns array('success'=>true) or array('error'=>'error message')
  */
 public function handleUpload()
 {
     if (!$this->file) {
         return array('error' => Tools::displayError('No files were uploaded.'));
     }
     $size = $this->file->getSize();
     if ($size == 0) {
         return array('error' => Tools::displayError('File is empty'));
     }
     if ($size > $this->sizeLimit) {
         return array('error' => Tools::displayError('File is too large'));
     }
     $pathinfo = pathinfo($this->file->getName());
     $these = implode(', ', $this->allowedExtensions);
     if (!isset($pathinfo['extension'])) {
         return array('error' => sprintf(Tools::displayError('File has an invalid extension, it should be one of these: %s.'), $these));
     }
     $ext = $pathinfo['extension'];
     if ($this->allowedExtensions && !in_array(strtolower($ext), $this->allowedExtensions)) {
         return array('error' => sprintf(Tools::displayError('File has an invalid extension, it should be one of these: %s.'), $these));
     }
     return $this->file->save();
 }
開發者ID:prestanesia,項目名稱:PrestaShop,代碼行數:26,代碼來源:FileUploader.php

示例2: getRepoName

 /**
  * Returns the name of the repository.
  *
  * @return string
  */
 function getRepoName()
 {
     return $this->repo ? $this->repo->getName() : 'unknown';
 }
開發者ID:schwarer2006,項目名稱:wikia,代碼行數:9,代碼來源:File.php

示例3: getName

 /**
  * Returns the display name for the student.
  *
  * @since 0.1
  *
  * @return String
  */
 public function getName()
 {
     return $this->getUser()->getRealName() === '' ? $this->user->getName() : $this->user->getRealName();
 }
開發者ID:realsoc,項目名稱:mediawiki-extensions,代碼行數:11,代碼來源:EPStudent.php

示例4: 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;
 }
開發者ID:cesarfelip3,項目名稱:clevermage_new,代碼行數:80,代碼來源:Mirasvit_Helpdesk_Model_Ticket.php


注:本文中的false::getName方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。