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


PHP School::getName方法代码示例

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


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

示例1: getName

    }
    /**
     * @return string
     */
    public function getName()
    {
        return $this->name;
    }
    /**
     * @return integer
     */
    private function enrolled()
    {
        return $this->enrolled();
    }
}
/*
 * The parameters here match those required by the class.
 * - Name of school
 * - Enrolled students
 */
$starkState = new School('Stark State', $enrolled = 8000);
echo $starkState->getName();
echo "<br />";
$starkState->setLocation('Canton');
echo $starkState->getLocation();
/*
 * Due to this being private, it will throw an error:
 * Fatal error: Call to private method School::enrolled()
 */
// $starkState->enrolled();
开发者ID:JarrodRizor,项目名称:LevelUpYourPHPMeetup,代码行数:31,代码来源:basic-class.php

示例2: addSchools

 public static function addSchools()
 {
     $class = get_called_class();
     decho("Adding schools for {$class}");
     foreach (static::getSchools() as $data) {
         print_r($data);
         $school = SchoolQuery::create()->filterByBookstoreType($class)->filterBySubdomain($data['Subdomain'])->findOne();
         if (!$school) {
             $school = new School();
             $school->setBookstoreType($class)->setSubdomain($data['Subdomain']);
         }
         $school->setSlug($data['Slug'])->setName($school->getName() ?: $data['Name'])->setShortName($school->getShortName(true) ?: (isset($data['ShortName']) ? $data['ShortName'] : School::guessShortName($data['Name'], $data['Slug'])))->setTouched(1)->save();
     }
 }
开发者ID:therealchiko,项目名称:getchabooks,代码行数:14,代码来源:Bookstore.php

示例3: assignToSchool

 /**
  * @param School $school
  * @param int $group
  * @param string $day
  */
 public function assignToSchool($school, $group, $day)
 {
     $this->setAssignedSchool($school->getName());
     if ($this->group == 1 && $group == 2 || $this->group == 2 && $group == 1) {
         $this->group = 3;
     } else {
         $this->setGroup($group);
     }
     $this->setAssignedDay($day);
 }
开发者ID:vegardbb,项目名称:webpage,代码行数:15,代码来源:Assistant.php


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