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


PHP Course::setTitle方法代码示例

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


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

示例1: Course

 function testCreate_OneToMany()
 {
     $this->_createModelAndIncludeThem('lecture', 'Lecture');
     $this->_createModelAndIncludeThem('course', 'Course');
     $course = new Course();
     $course->setTitle($course_title = 'bar');
     $course->save();
     $lecture = new Lecture();
     $lecture->setTitle($lecture_title = 'foo');
     $lecture->setCourse($course);
     $lecture->save();
     $loaded_lecture = lmbActiveRecord::findById('Lecture', $lecture->getId());
     $this->assertEqual($loaded_lecture->getTitle(), $lecture_title);
     $this->assertEqual($loaded_lecture->getCourse()->getId(), $course->getId());
     $loaded_course = lmbActiveRecord::findById('Course', $course->getId());
     $this->assertEqual($loaded_course->getLectures()->at(0)->getId(), $lecture->getId());
 }
开发者ID:snowjobgit,项目名称:limb,代码行数:17,代码来源:lmbModelConstructorTest.class.php

示例2: course_sort

 public function course_sort($courseSections)
 {
     //First, we declare an array to hold subjects
     $result = array();
     //We get the name of the first element, then use that to re-sort each
     //section by subject
     while (count($courseSections) > 0) {
         $name = reset($courseSections)->getCourse()->getCourseName();
         $new_res = array_filter($courseSections, function ($elem) use($name) {
             return $elem->getCourse()->getCourseName() === $name;
         });
         $courseSections = array_filter($courseSections, function ($elem) use($name) {
             return $elem->getCourse()->getCourseName() != $name;
         });
         array_push($result, $new_res);
     }
     $copy = $result;
     $result = array();
     //Now that we have the subjects, we need to group sections into courses by course number
     foreach ($copy as $r) {
         $next = array();
         while (count($r) > 0) {
             $num = reset($r)->getCourse()->getCourseNumber();
             $new_res = array_filter($r, function ($elem) use($num) {
                 return $elem->getCourse()->getCourseNumber() === $num;
             });
             $r = array_filter($r, function ($elem) use($num) {
                 return $elem->getCourse()->getCourseNumber() != $num;
             });
             array_push($next, $new_res);
         }
         array_push($result, $next);
     }
     /*$result = array_filter($result, function($elem)
       {
           return count($elem) > 0;
       });*/
     $copy = $result;
     $result = array();
     foreach ($copy as $res) {
         foreach ($res as $r) {
             usort($r, function ($a, $b) {
                 return $a->getSectionName() < $b->getSectionName() ? 1 : -1;
             });
         }
         array_push($result, $res);
     }
     $copy = $result;
     $result = array();
     foreach ($copy as $r) {
         usort($r, function ($a, $b) {
             return reset($a)->getCourse()->getCourseNumber() > reset($b)->getCourse()->getCourseNumber() ? 1 : -1;
         });
         array_push($result, $r);
     }
     usort($result, function ($a, $b) {
         return reset(reset($a))->getCourse()->getCourseName() > reset(reset($b))->getCourse()->getCourseName() ? 1 : -1;
     });
     $copy = $result;
     $result = array();
     foreach ($copy as $subj) {
         $subject = new Subject();
         $subject->setName(reset(reset($subj))->getCourse()->getCourseName());
         $subject->setTitle(reset(reset($subj))->getCourse()->getCourseCategoryName());
         $courses = array();
         foreach ($subj as $crs) {
             $course = new Course();
             $course->setName(reset($crs)->getCourse()->getCourseNumber());
             $course->setTitle(reset($crs)->getCourse()->getCourseTitle());
             $course->setHours(reset($crs)->getHours());
             $course->setSections($crs);
             array_push($courses, $course);
         }
         $subject->setCourses($courses);
         array_push($result, $subject);
     }
     return $result;
 }
开发者ID:Troutzorz,项目名称:csapp,代码行数:78,代码来源:Advisingform.php

示例3: Message

     Message::register(new Message(Message::DANGER, i18n(array("en" => "country_id is required.", "zh" => "请填写country_id"))));
     $error_flag = true;
 }
 // validation for $content
 $content = isset($_POST["content"]) ? $_POST["content"] : null;
 if (empty($content)) {
     Message::register(new Message(Message::DANGER, i18n(array("en" => "content is required.", "zh" => "请填写content"))));
     $error_flag = true;
 }
 // validation for $url
 $url = isset($_POST["url"]) ? strip_tags($_POST["url"]) : null;
 // validation for $weight
 $weight = isset($_POST["weight"]) ? strip_tags($_POST["weight"]) : null;
 /// proceed submission
 // proceed for $title
 $object->setTitle($title);
 // proceed for $country_id
 if (!empty($country_id)) {
     $object->setCountryId($country_id);
 }
 // proceed for $content
 $object->setContent($content);
 // proceed for $url
 $object->setUrl($url);
 // proceed for $weight
 $object->setWeight($weight);
 if ($error_flag == false) {
     if ($object->save()) {
         Message::register(new Message(Message::SUCCESS, i18n(array("en" => "Record saved", "zh" => "记录保存成功"))));
         HTML::forwardBackToReferer();
     } else {
开发者ID:jeffreycai,项目名称:ct21,代码行数:31,代码来源:course_create.php

示例4: getDemoCourseDetail

 /**
  * A sample detail bean for use in rendering the template.
  * If a course is supplied, it will copy thevalues of the
  * given bean over the top of the demo bean.
  * @return
  */
 private function getDemoCourseDetail($crse)
 {
     require_once WEB_INF . '/beans/Performance.php';
     require_once WEB_INF . '/beans/Schedule.php';
     require_once WEB_INF . '/beans/Venue.php';
     global $logger;
     $logger->debug(get_class($this) . "::getDemoCourseDetail({$crse})");
     $bean = new Course();
     $bean->setTitle("Demo Course Detail Bean");
     $desc = "<p>This is a description of the course. Malian Grammy Award nominee Mamadou Diabate is a virtuoso kora player descended from a long line of Manding musician-storytellers. Dolor dignissim exerci feugiat. Lobortis ut, luptatum facilisis. Augue volutpat facilisis at, eum consequat adipiscing accumsan blandit molestie. </p>\n\t\t\t\t <p>Lobortis eros at hendrerit luptatum consequat feugiat ut facilisi commodo esse autem consequat at ex ullamcorper hendrerit wisi, commodo nostrud nisl wisi eum autem eu esse eu iriure. Tation, magna ad nibh at eum, ea praesent eum lorem eu erat enim commodo dolore?</p>\n \t\t\t\t <p>Crisare enim sed ex eros hendrerit blandit illum qui sciurus autem nulla enim luptatum. Quis enim eum feugait elit blandit, hendrerit consequat, velit ut luptatum nostrud wisi ea. Dignissim consequat dolore aliquam eum volutpat, wisi dolore et exerci nisl veniam luptatum ut ullamcorper consequatvel nulla delenit.</p>\n\t\t\t\t";
     $bean->setDescription($desc);
     $bean->setPrimaryGenre("Music");
     // Performances
     $perf = new Performance();
     $schd = new Schedule();
     $schd->setStartTime(time());
     $perf->setSchedule($schd);
     $logger->debug("Performance time: " . $perf->getSchedule()->getStartTime());
     $perf->setTicketCode("21");
     $bean->setChildren(array($perf));
     $logger->debug("Number of set performaces: " . count($bean->getChildren()));
     // Venues
     $v1 = new Venue();
     $v1->setName('Hurd Gallery');
     $bean->setDefaultVenue($v1);
     if (get_class($crse) == 'Course') {
         $crse->setPerformances(null);
         $option = new CopyBeanOption();
         $option->setIgnoreNullValues(true);
         BeanUtil::copyBean($crse, $bean, $option);
     }
     return $bean;
 }
开发者ID:justinlyon,项目名称:scc,代码行数:39,代码来源:FrontCourseAction.php

示例5: Course

<li>雅思预备课程(读五周以上):<br />
A) 早班 : 星期一至星期四,  (8:45am – 2:30pm) ,每周学费$190
<br />
B) 晚班 : 星期一至星期五, (4:00pm – 8:30pm  ) ,每周学费$190
</li>
</ol>

<h3>院校介绍:</h3>
<p>
位于新南威尔士州悉尼市,是澳大利亚一所历史悠久的私立学院。学院提供英语方面的课程,包括通用英语,雅思预备英语课程,学术英语课程。同时,学院还提供商务三级证书,商务四级证书和商务文凭的职业教育商专课程。 
</p>
');
    $course->save();
    $course = new Course();
    $course->setTitle('证书和文凭课程, 每三个月学费仅A$1,300,半年仅$2300');
    $course->setCountryId(1);
    $course->setWeight(1);
    $course->setContent('
<p>三级证书,四级证书,管理文凭课程,每三个月仅$1300,六个月学费一次付清只需 $2,300</p>
<p>
A) 三级证书,Certificate III in Busines:
<br />
六个月学费分两次支付: $1,300 / 3 个月
<br />
六个月学费一次付清只需 $2,300 / 6 个月
<br />
早班 :星期三至星期四, (8:30am – 5:00pm)
<br />
晚班 :  星期一至星期三, (5:00pm – 10:00pm )
<br />
开发者ID:jeffreycai,项目名称:ct21,代码行数:30,代码来源:fixture.php


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