当前位置: 首页>>代码示例>>PHP>>正文


PHP type::getName方法代码示例

本文整理汇总了PHP中type::getName方法的典型用法代码示例。如果您正苦于以下问题:PHP type::getName方法的具体用法?PHP type::getName怎么用?PHP type::getName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在type的用法示例。


在下文中一共展示了type::getName方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleFileUpload

 /**
  * Handles a single upload by given CUploadedFile and returns an array
  * of informations.
  *
  * The 'error' attribute of the array, indicates there was an error.
  *
  * Informations on error:
  *       - error: true
  *       - errorMessage: some message
  *       - name: name of the file
  *       - size: file size
  *
  * Informations on success:
  *      - error: false
  *      - name: name of the uploaded file
  *      - size: file size
  *      - guid: of the file
  *      - url: url to the file
  *      - thumbnailUrl: url to the thumbnail if exists
  *
  * @param type $cFile
  * @return Array Informations about the uploaded file
  */
 protected function handleFileUpload($cFile)
 {
     $output = array();
     // Set some basic information
     $output['name'] = $cFile->getName();
     $output['size'] = $cFile->getSize();
     // Received a file?
     if ($cFile == null) {
         $output['error'] = true;
         $output['errorMessage'] = Yii::t('FileModule.controllers_FileController', 'No file received!');
         return $output;
     }
     // Maximum File Size
     if ($cFile->getSize() > HSetting::Get('maxFileSize', 'file')) {
         $output['error'] = true;
         $output['errorMessage'] = Yii::t('FileModule.controllers_FileController', 'Maximum file size has been {maxFileSize} reached!', array("{maxFileSize}" => Yii::app()->format->formatSize(HSetting::Get('maxFileSize', 'file'))));
         return $output;
     }
     if (!File::HasValidExtension($cFile->getName())) {
         $output['error'] = true;
         $output['errorMessage'] = Yii::t('FileModule.controllers_FileController', 'This file type is not allowed!');
         return $output;
     }
     // Store File
     $file = File::store($cFile);
     // Check File Storage
     if ($file == null) {
         $output['state'] = 'error';
         $output['errorMessage'] = Yii::t('FileModule.controllers_FileController', 'Internal Error: Could not store file!');
         return $output;
     }
     // Write successful array
     $output['error'] = false;
     $output['guid'] = $file->guid;
     $output['name'] = $file->file_name;
     $output['title'] = $file->title;
     $output['url'] = "";
     $output['thumbnailUrl'] = "";
     $output['size'] = $file->size;
     $output['deleteUrl'] = "";
     $output['deleteType'] = "";
     $output['mimeIcon'] = $file->getMimeIconClass();
     return $output;
 }
开发者ID:ahdail,项目名称:humhub,代码行数:67,代码来源:FileController.php

示例2: createInvoicePosition

 /**
  * 
  * @param type $item
  * @return \ifirma\InvoicePosition
  */
 protected function createInvoicePosition($item)
 {
     $invoicePosition = new ifirma\InvoicePosition();
     $invoicePosition->{ifirma\InvoicePosition::KEY_JEDNOSTKA} = self::DEFAULT_UNIT_NAME;
     $invoicePosition->{ifirma\InvoicePosition::KEY_STAWKA_VAT} = sprintf("%.2f", $item->getTaxPercent() / 100);
     $invoicePosition->{ifirma\InvoicePosition::KEY_ILOSC} = $item->getQtyOrdered();
     $invoicePosition->{ifirma\InvoicePosition::KEY_CENA_JEDNOSTKOWA} = $this->roundPrice($item->getPriceInclTax());
     $invoicePosition->{ifirma\InvoicePosition::KEY_NAZWA_PELNA} = $item->getName();
     $invoicePosition->{ifirma\InvoicePosition::KEY_TYP_STAWKI_VAT} = ifirma\InvoicePosition::DEFAULT_VALUE_TYP_STAWKI_VAT;
     return $invoicePosition;
 }
开发者ID:s-neilo,项目名称:ifirma-api-sklepy,代码行数:16,代码来源:StrategyAbstract.php

示例3: run

 /**
  * Run the analysis
  *
  * @return \Puml\Model\Object
  * @since 0.1
  */
 public function run()
 {
     $this->reflectedObject = new \ReflectionClass($this->objectName);
     $this->object->setName($this->reflectedObject->getName());
     /* Analyse its properties */
     $this->extractProperties($this->reflectedObject, $this->object);
     /* Analyse its methods */
     $this->extractMethods($this->reflectedObject, $this->object);
     /* Analyse its parents */
     $this->determineParent($this->reflectedObject, $this->object);
     return $this->object;
 }
开发者ID:dannyvdsluijs,项目名称:puml,代码行数:18,代码来源:Analyser.php

示例4: _downloadEmptyItem

 /**
  * will download a zip file with the same name as the item name,
  * if the item exists, then will exit.
  *
  * @param type $item
  */
 private function _downloadEmptyItem($item)
 {
     ob_start();
     $this->disableView();
     if (isset($item) && $item instanceof ItemDao) {
         $name = $item->getName();
     } else {
         $name = 'No_item_selected';
     }
     $name = substr($name, 0, 50);
     if (headers_sent()) {
         echo $name;
         // this is used in testing mode since we cannot send headers from ZipStream
         return;
     }
     $zip = new \ZipStream\ZipStream($name . '.zip');
     $zip->finish();
     exit;
 }
开发者ID:josephsnyder,项目名称:Midas,代码行数:25,代码来源:DownloadController.php

示例5: _generateElement

 /**
  * Create one element
  * 
  * @param type $node
  */
 private function _generateElement($node)
 {
     if (!$node->isAllow()) {
         return;
     }
     $cssClasses = array();
     $cssActive = '';
     if ($node->isActive()) {
         $cssActive = 'class="active"';
     }
     if (!is_null($node->getClass())) {
         $cssClasses[] = $node->getClass();
     }
     $class = count($cssClasses) > 0 ? " class='" . implode(',', $cssClasses) . "'" : '';
     $id = !is_null($node->getId()) ? " id='" . $node->getId() . "'" : '';
     $target = !is_null($node->getTarget()) ? " target='" . $node->getTarget() . "'" : '';
     $this->html .= "\t\t" . '<li ' . $cssActive . '>' . PHP_EOL;
     if (!$node->hasChilds()) {
         $this->html .= "\t\t\t" . '<a href="' . $node->getUrl() . '" ' . $target . ' class="nav-header" ><span' . $class . '></span> ' . $this->_translate($node->getName()) . "</a>" . PHP_EOL;
     }
     //generate childs
     if ($node->hasChilds()) {
         //$this->html .= "\t\t<div class='dropdown'>" . PHP_EOL;
         $this->html .= '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">' . $this->_translate($node->getName()) . ' <span class="caret"></span></a>' . PHP_EOL;
         $this->html .= "\t\t<ul class=\"dropdown-menu\">" . PHP_EOL;
         $this->_generateChilds($node->getChilds());
         $this->html .= "\t\t</ul>" . PHP_EOL;
         //$this->html .= "\t\t</div>" . PHP_EOL;
     }
     $this->html .= "\t\t</li>" . PHP_EOL;
 }
开发者ID:zedmaster,项目名称:ticobox,代码行数:36,代码来源:Navigate.php

示例6: isDifferent

 /**
  * 
  * @param type $original_field
  * @param type $newfield
  */
 private function isDifferent($original_field, $newfield)
 {
     $check = array("type" => array("setter" => "setType", "getter" => "getType"), "default" => array("setter" => "setDefault", "getter" => "getDefault"), "extra" => array("setter" => "setExtra", "getter" => "getExtra"), "key" => array("setter" => "setKey", "getter" => "getKey"), "nullable" => array("setter" => "setNullable", "getter" => "getNullable"));
     $diverso = false;
     foreach ($check as $nome => $metodi) {
         $getter = $metodi["getter"];
         if (trim(strtolower($original_field->{$getter}())) != trim(strtolower($newfield->{$getter}()))) {
             $diverso = true;
         }
     }
     if ($diverso) {
         $this->diversi[$original_field->getName()] = $newfield;
     }
 }
开发者ID:Zanej,项目名称:cms,代码行数:19,代码来源:EntityCreator.php

示例7: getCleanName

 /**
  * Get a clean name of an element. to be used for Ids
  * @param type $element
  * @return type
  */
 public function getCleanName($element)
 {
     return str_replace(array('[', ']'), '', $element->getName());
 }
开发者ID:dennesabing,项目名称:dxapp,代码行数:9,代码来源:FormRowTwb.php

示例8: _generateElement

 /**
  * Create one element
  * 
  * @param type $node
  */
 private function _generateElement($node)
 {
     $cssClasses = array();
     if ($node->isActive()) {
         $cssClasses[] = 'active';
     }
     if (!is_null($node->getClass())) {
         $cssClasses[] = $node->getClass();
     }
     $class = count($cssClasses) > 0 ? " class='" . implode(',', $cssClasses) . "'" : '';
     $id = !is_null($node->getId()) ? " id='" . $node->getId() . "'" : '';
     $target = !is_null($node->getTarget()) ? " target='" . $node->getTarget() . "'" : '';
     $this->html .= "\t\t<li{$class} {$id}>" . PHP_EOL;
     $this->html .= "\t\t\t<a title='" . $this->_translate($node->getName()) . "' href='" . $node->getUrl() . "' {$target}>" . $this->_translate($node->getName()) . "</a>" . PHP_EOL;
     //generate childs
     if ($node->hasChilds()) {
         $this->html .= "\t\t<div class='dropdown'>" . PHP_EOL;
         $this->html .= "\t\t<ul>" . PHP_EOL;
         $this->_generateChilds($node->getChilds());
         $this->html .= "\t\t</ul>" . PHP_EOL;
         $this->html .= "\t\t</div>" . PHP_EOL;
     }
     $this->html .= "\t\t</li>" . PHP_EOL;
 }
开发者ID:kmsquared,项目名称:phalcon-navigation,代码行数:29,代码来源:Navigate.php

示例9: poUserGetRights

/**
 * Dynamically assign "protect" right when needed 
 * @global type $wgTitle
 * @global type $wgProtectOwnDoProtect
 * @param type $user
 * @param type $aRights
 * @return type 
 */
function poUserGetRights($user, &$aRights)
{
    // When updating title's restriction, "protect" and user's group rights are needed
    // so when flushing rights (in Form() code), the next lines grant the rights.
    // Activated by setting $wgProtectOwnDoProtect to true.
    global $wgProtectOwnDoProtect, $wgTitle;
    if ($wgProtectOwnDoProtect) {
        wfDebugLog('ProtectOwn', 'UserGetRights: GRANT "protect"' . ' to ' . $user->getName() . '"[' . $user->getID() . ']');
        $aRights[] = 'protect';
        $aRights = array_unique($aRights);
    }
    poGrantProtectionRights($wgTitle, $user, $aRights);
    return true;
    // don't stop hook processing
}
开发者ID:eFFemeer,项目名称:seizamcore,代码行数:23,代码来源:ProtectOwn.php


注:本文中的type::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。