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


PHP Course::setDescription方法代码示例

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


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

示例1: 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

示例2: City

require_once './Book.php';
require_once './Student.php';
require_once './Course.php';
require_once './City.php';
//SAVE
$c = new City();
$c->setName('San Francisco');
$c->save();
$s = new Student();
$s->setCity($c);
$s->setEmail('test@hypersistence.com');
$s->setName('Mateus Fornari');
$s->setNumber('123456');
var_dump($s->save());
$course = new Course();
$course->setDescription('PHP Programming');
$course->save();
$s->addCourses($course);
$p = new Person();
$p->setCity($c);
$p->setEmail('other@hypersistence.com');
$p->setName('Other Person');
$p->save();
$b = new Book();
$b->setAuthor($p);
$b->setTitle('PHP Book');
$b->save();
Hypersistence::commit();
//LOAD
$p = new Person();
$p->setId(1);
开发者ID:mateusfornari,项目名称:hypersistence-alpha,代码行数:31,代码来源:index.php

示例3: testgroundTask

 /**
  * Display default page
  *
  * @return     void
  */
 public function testgroundTask()
 {
     if (0) {
         // CREATE COUPON
         include_once JPATH_BASE . DS . 'components' . DS . 'com_storefront' . DS . 'models' . DS . 'StorefrontModelCoupon.php';
         try {
             // Constructor take the coupon code
             $coupon = new Coupon('hui');
             // Coupon description (shows up in the cart)
             $coupon->setDescription('Test coupon, 10% off product with ID 3');
             // Expiration date
             $coupon->setExpiration('Feb 22, 2022');
             // Number of times coupon can be used (unlimited by default)
             $coupon->setUseLimit(1);
             // Product the coupon will be applied to:
             // first parameter: product ID
             // second parameter [optional, unlimited by default]: max quantity of products coupon will be applied to (if buying multiple)
             $coupon->addObject(3, 1);
             // Action, only 'discount' for now
             // second parameter either percentage ('10%') or absolute dollar value ('20')
             $coupon->setAction('discount', '10%');
             // Add coupon
             $coupon->add();
         } catch (\Exception $e) {
             echo 'ERROR: ' . $e->getMessage();
         }
         return;
     }
     if (0) {
         // DELETE COUPON
         $warehouse = new Warehouse();
         try {
             $warehouse->deleteCoupon('couponcode3');
         } catch (\Exception $e) {
             echo 'ERROR: ' . $e->getMessage();
         }
         return;
     }
     if (0) {
         // CREATE NEW COURSE
         include_once JPATH_BASE . DS . 'components' . DS . 'com_storefront' . DS . 'models' . DS . 'Course.php';
         $course = new Course();
         $course->setName('Name of the course');
         $course->setDescription('Short description');
         $course->setPrice(12.0);
         $course->addToCollection('courses');
         // Membership model: membership duration period (must me in MySQL date format: 1 DAY, 2 MONTH, 3 YEAR...)
         $course->setTimeToLive('1 YEAR');
         // Course alias id
         $course->setCourseId('nanoscaletransistors');
         try {
             // Returns object with values, pId is the new product ID to link to
             $info = $course->add();
             //print_r($info);
         } catch (\Exception $e) {
             echo 'ERROR: ' . $e->getMessage();
         }
         return;
     }
     if (0) {
         // GET EXISTING COURSE, modify it and save
         $warehouse = new Warehouse();
         try {
             // Get course by pID returned with $course->add() above
             $course = $warehouse->getCourse(1);
             $course->setName('Renamed');
             $course->setDescription('New description');
             $course->setPrice(55.22);
             $course->setTimeToLive('10 YEAR');
             $course->update();
         } catch (\Exception $e) {
             echo 'ERROR: ' . $e->getMessage();
         }
         return;
     }
     if (0) {
         // UPDATE COURSE by recreating it
         include_once JPATH_BASE . DS . 'components' . DS . 'com_storefront' . DS . 'models' . DS . 'StorefrontModelCourse.php';
         $course = new Course();
         $course->setName('Operations Management 104');
         $course->setDescription('Operations Management 104 is some kind of test course for now...');
         $course->setPrice(13.05);
         $course->setCourseId(5);
         // Existing course ID (pID returned with $course->add() when the course was created). Must be set to be able to update.
         $course->setId(1023);
         try {
             $info = $course->update();
             //print_r($info);
         } catch (\Exception $e) {
             echo 'ERROR: ' . $e->getMessage();
         }
         return;
     }
     if (0) {
         // DELETE COURSE
//.........这里部分代码省略.........
开发者ID:mined-gatech,项目名称:hubzero-cms,代码行数:101,代码来源:test.php


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