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


PHP self::setName方法代码示例

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


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

示例1: createSupportGroup

 /**
  * Wrapper for creating a support group.
  * It will check if the support group doesn't exist yet, if the tag or name already exists then NAME_TAKEN  or TAG_TAKEN will be returned.
  * If the name is bigger than 20 characters or smaller than 4 and the tag greater than 7 or smaller than 2 a SIZE_ERROR will be returned.
  * Else it will return SUCCESS
  * @return a string that specifies if it was a success or not (SUCCESS, SIZE_ERROR, NAME_TAKEN or TAG_TAKEN )
  */
 public static function createSupportGroup($name, $tag, $groupemail, $imap_mailserver, $imap_username, $imap_password)
 {
     //error_log( "Error at line " . __LINE__ . " in file " . __FILE__);
     if (strlen($name) <= 21 && strlen($name) >= 4 && strlen($tag) <= 8 && strlen($tag) >= 2) {
         $notExists = self::supportGroup_EntryNotExists($name, $tag);
         //error_log( "Error at line " . __LINE__ . " in file " . __FILE__);
         if ($notExists == "SUCCESS") {
             $sGroup = new self();
             $values = array('Name' => $name, 'Tag' => $tag, 'GroupEmail' => $groupemail, 'IMAP_MailServer' => $imap_mailserver, 'IMAP_Username' => $imap_username, 'IMAP_Password' => $imap_password);
             $sGroup->setName($values['Name']);
             $sGroup->setTag($values['Tag']);
             $sGroup->setGroupEmail($values['GroupEmail']);
             $sGroup->setIMAP_MailServer($values['IMAP_MailServer']);
             $sGroup->setIMAP_Username($values['IMAP_Username']);
             //encrypt password!
             global $cfg;
             $crypter = new MyCrypt($cfg['crypt']);
             $enc_password = $crypter->encrypt($values['IMAP_Password']);
             $sGroup->setIMAP_Password($enc_password);
             $sGroup->create();
             //error_log( "Error at line " . __LINE__ . " in file " . __FILE__);
         } else {
             //error_log( "Error at line " . __LINE__ . " in file " . __FILE__);
             //return NAME_TAKEN  or TAG_TAKEN
             return $notExists;
         }
     } else {
         //error_log( "Error at line " . __LINE__ . " in file " . __FILE__);
         //RETURN ERROR that indicates SIZE
         return "SIZE_ERROR";
     }
 }
开发者ID:ryzom,项目名称:ryzomcore,代码行数:39,代码来源:support_group.php

示例2: createFromXML

 /**
  * @param SimpleXMLElement $xml
  *
  * @return Product
  */
 public static function createFromXML(SimpleXMLElement $xml)
 {
     /*
     <product default="true" name="bpack 24/7">
       <price price20To30="750" price10To20="650" price5To10="550" price2To5="450" priceLessThan2="350" countryIso2Code="BE"/>
       <option visiblity="NOT_VISIBLE_BY_CONSUMER_OPTIONAL" price="0" name="Saturday"/>
       <option visiblity="NOT_VISIBLE_BY_CONSUMER_OPTIONAL" price="0" name="Info &quot;Distributed&quot;"/>
       <option visiblity="NOT_VISIBLE_BY_CONSUMER_OPTIONAL" price="0" name="Insurance"/>
     </product>
     */
     $attributes = $xml->attributes();
     $children = $xml->children();
     $product = new self();
     $product->setDefault($attributes['default'] == 'true');
     $product->setName($attributes['name']);
     if (isset($children->price)) {
         foreach ($children->price as $priceXml) {
             $product->addPrice(Price::createFromXML($priceXml));
         }
     }
     if (isset($children->option)) {
         foreach ($children->option as $optionXml) {
             $product->addOption(Option::createFromXML($optionXml));
         }
     }
     return $product;
 }
开发者ID:Antidot-be,项目名称:bpost-api-library,代码行数:32,代码来源:Product.php

示例3: newInstance

 public static function newInstance($name, $container)
 {
     $instance = new self();
     $instance->setName($name);
     $instance->setContainer($container);
     return $instance;
 }
开发者ID:kohkimakimoto,项目名称:altax,代码行数:7,代码来源:DefinedTask.php

示例4: fromReflection

    /**
     * fromReflection()
     *
     * @param Zend_Reflection_Property $reflectionProperty
     * @return Zend_CodeGenerator_Php_Property
     */
    public static function fromReflection(Zend_Reflection_Property $reflectionProperty)
    {
        $property = new self();

        $property->setName($reflectionProperty->getName());

        $allDefaultProperties = $reflectionProperty->getDeclaringClass()->getDefaultProperties();

        $property->setDefaultValue($allDefaultProperties[$reflectionProperty->getName()]);

        if ($reflectionProperty->getDocComment() != '') {
            $property->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionProperty->getDocComment()));
        }

        if ($reflectionProperty->isStatic()) {
            $property->setStatic(true);
        }

        if ($reflectionProperty->isPrivate()) {
            $property->setVisibility(self::VISIBILITY_PRIVATE);
        } elseif ($reflectionProperty->isProtected()) {
            $property->setVisibility(self::VISIBILITY_PROTECTED);
        } else {
            $property->setVisibility(self::VISIBILITY_PUBLIC);
        }

        $property->setSourceDirty(false);

        return $property;
    }
开发者ID:nhp,项目名称:shopware-4,代码行数:36,代码来源:Property.php

示例5: fromReflection

    /**
     * fromReflection()
     *
     * @param  MethodReflection $reflectionMethod
     * @return MethodGenerator
     */
    public static function fromReflection(MethodReflection $reflectionMethod)
    {
        $method = new self();

        $method->setSourceContent($reflectionMethod->getContents(false));
        $method->setSourceDirty(false);

        if ($reflectionMethod->getDocComment() != '') {
            $method->setDocBlock(DocBlockGenerator::fromReflection($reflectionMethod->getDocBlock()));
        }

        $method->setFinal($reflectionMethod->isFinal());

        if ($reflectionMethod->isPrivate()) {
            $method->setVisibility(self::VISIBILITY_PRIVATE);
        } elseif ($reflectionMethod->isProtected()) {
            $method->setVisibility(self::VISIBILITY_PROTECTED);
        } else {
            $method->setVisibility(self::VISIBILITY_PUBLIC);
        }

        $method->setStatic($reflectionMethod->isStatic());

        $method->setName($reflectionMethod->getName());

        foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
            $method->setParameter(ParameterGenerator::fromReflection($reflectionParameter));
        }

        $method->setBody($reflectionMethod->getBody());

        return $method;
    }
开发者ID:necrogami,项目名称:zf2,代码行数:39,代码来源:MethodGenerator.php

示例6: fromReflection

 public static function fromReflection(ZendL_Reflection_Class $reflectionClass)
 {
     $class = new self();
     $class->setSourceContent($class->getSourceContent());
     $class->setSourceDirty(false);
     if ($reflectionClass->getDocComment() != '') {
         $class->setDocblock(ZendL_Tool_CodeGenerator_Php_Docblock::fromReflection($reflectionClass->getDocblock()));
     }
     $class->setAbstract($reflectionClass->isAbstract());
     $class->setName($reflectionClass->getName());
     if ($parentClass = $reflectionClass->getParentClass()) {
         $class->setExtendedClass($parentClass->getName());
     }
     $class->setImplementedInterfaces($reflectionClass->getInterfaceNames());
     $properties = array();
     foreach ($reflectionClass->getProperties() as $reflectionProperty) {
         if ($reflectionProperty->getDeclaringClass()->getName() == $class->getName()) {
             $properties[] = ZendL_Tool_CodeGenerator_Php_Property::fromReflection($reflectionProperty);
         }
     }
     $class->setProperties($properties);
     $methods = array();
     foreach ($reflectionClass->getMethods() as $reflectionMethod) {
         if ($reflectionMethod->getDeclaringClass()->getName() == $class->getName()) {
             $methods[] = ZendL_Tool_CodeGenerator_Php_Method::fromReflection($reflectionMethod);
         }
     }
     $class->setMethods($methods);
     return $class;
 }
开发者ID:lortnus,项目名称:zf1,代码行数:30,代码来源:Class.php

示例7: withAttributes

 /**
  * Creates a new Guild object with attributes
  *
  * @param $name string Name of the guild
  * @param $banner string Banner of the guild
  * @return Guild The newly created guild
  */
 public static function withAttributes($name, $banner)
 {
     $instance = new self();
     $instance->setName($name);
     $instance->setBanner($banner);
     return $instance;
 }
开发者ID:JMartelot,项目名称:tpwebservices,代码行数:14,代码来源:Guild.php

示例8: fromReflection

 public static function fromReflection(Zend_Reflection_Method $reflectionMethod)
 {
     $method = new self();
     $method->setSourceContent($reflectionMethod->getContents(false));
     $method->setSourceDirty(false);
     if ($reflectionMethod->getDocComment() != '') {
         $method->setDocblock(Zend_CodeGenerator_Php_Docblock::fromReflection($reflectionMethod->getDocblock()));
     }
     $method->setFinal($reflectionMethod->isFinal());
     if ($reflectionMethod->isPrivate()) {
         $method->setVisibility(self::VISIBILITY_PRIVATE);
     } elseif ($reflectionMethod->isProtected()) {
         $method->setVisibility(self::VISIBILITY_PROTECTED);
     } else {
         $method->setVisibility(self::VISIBILITY_PUBLIC);
     }
     $method->setStatic($reflectionMethod->isStatic());
     $method->setName($reflectionMethod->getName());
     foreach ($reflectionMethod->getParameters() as $reflectionParameter) {
         $method->setParameter(Zend_CodeGenerator_Php_Parameter::fromReflection($reflectionParameter));
     }
     $body = $reflectionMethod->getBody();
     $body2 = str_replace("\n\n", "\n", $body);
     $body2 = preg_replace("|^\n\\s{4}|muU", "\n", $body2);
     $body2 = preg_replace("|^\\s{4}|muU", "", $body2);
     //    $body2 = str_replace(' ', '.', $body2);
     //dmDebug::kill($body, "\n".$body2);
     $method->setBody($body2);
     return $method;
 }
开发者ID:theolymp,项目名称:diem,代码行数:30,代码来源:Method.php

示例9: __set_state

 /**
  * @param array $data
  *
  * @return Route
  */
 public static function __set_state($data)
 {
     $route = new self($data['pattern'], $data['callback'], $data['args'], $data['requirements']);
     if (isset($data['name'])) {
         $route->setName($data['name']);
     }
     return $route;
 }
开发者ID:rsrodrig,项目名称:MeetMeSoftware,代码行数:13,代码来源:Route.php

示例10: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
  * @return Zend_CodeGenerator_Php_Docblock_Tag_License
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagLicense)
 {
     $returnTag = new self();
     $returnTag->setName('license');
     $returnTag->setUrl($reflectionTagLicense->getUrl());
     $returnTag->setDescription($reflectionTagLicense->getDescription());
     return $returnTag;
 }
开发者ID:Yaoming9,项目名称:Projet-Web-PhP,代码行数:14,代码来源:License.php

示例11: initWithArray

 public static function initWithArray($array)
 {
     $instance = new self(NULL, NULL, NULL);
     $instance->setName($array[EventCategory::EVENTCATEGORY_NAME]);
     $instance->setId($array[EventCategory::EVENTCATEGORY_ID]);
     $instance->setPar_cat($array[EventCategory::EVENTCATEGORY_PAR_CAT]);
     return $instance;
 }
开发者ID:anasanzari,项目名称:tathva-organizer,代码行数:8,代码来源:EventCategory.php

示例12: fromReflection

 /**
  * fromReflection()
  *
  * @param \Zend\Code\Reflection\ReflectionDocblockTag $reflectionTagReturn
  * @return \Zend\Code\Generator\DocBlock\Tag\ReturnTag
  */
 public static function fromReflection(\Zend\Code\Reflection\DocBlock\TagInterface $reflectionTagReturn)
 {
     $returnTag = new self();
     $returnTag->setName('return');
     $returnTag->setDatatype($reflectionTagReturn->getType());
     // @todo rename
     $returnTag->setDescription($reflectionTagReturn->getDescription());
     return $returnTag;
 }
开发者ID:rikaix,项目名称:zf2,代码行数:15,代码来源:ReturnTag.php

示例13: fromReflection

 /**
  * fromReflection()
  *
  * @param Zend_Reflection_Docblock_Tag $reflectionTagReturn
  * @return Zend_CodeGenerator_Php_Docblock_Tag_Return
  */
 public static function fromReflection(Zend_Reflection_Docblock_Tag $reflectionTagReturn)
 {
     $returnTag = new self();
     $returnTag->setName('return');
     $returnTag->setDatatype($reflectionTagReturn->getType());
     // @todo rename
     $returnTag->setDescription($reflectionTagReturn->getDescription());
     return $returnTag;
 }
开发者ID:ramonornela,项目名称:Zebra,代码行数:15,代码来源:Return.php

示例14: create

 /**
  * Criar Item com campos obrigatórios preenchidos
  *
  * @param string $id - Código do Produto
  * @param string $name - Nome do Produto
  * @param float $value - Valor Unitário
  * @param integer $quantity - Quantidade
  *
  * @return Item
  */
 public static function create($id, $name, $value, $quantity)
 {
     $instance = new self();
     $instance->setId($id);
     $instance->setName($name);
     $instance->setValue($value);
     $instance->setQuantity($quantity);
     return $instance;
 }
开发者ID:lucasmro,项目名称:clearsale,代码行数:19,代码来源:Item.php

示例15: getByName

 /**
  * @param $name
  * @return Model\Tool\CustomReport\Config
  * @throws \Exception
  */
 public static function getByName($name)
 {
     $code = new self();
     $code->setName($name);
     if (!$code->load()) {
         throw new \Exception("sql report definition : " . $name . " does not exist");
     }
     return $code;
 }
开发者ID:sfie,项目名称:pimcore,代码行数:14,代码来源:Config.php


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