當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dog::setBreed方法代碼示例

本文整理匯總了PHP中Dog::setBreed方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dog::setBreed方法的具體用法?PHP Dog::setBreed怎麽用?PHP Dog::setBreed使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dog的用法示例。


在下文中一共展示了Dog::setBreed方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: start

 public static function start()
 {
     $target = isset($_GET['target']) ? $_GET['target'] : 'showForm';
     switch ($target) {
         case 'register':
             require_once dirname(__FILE__) . '/ParticipationView.php';
             if (isset($_GET['idExhibition']) && $_GET['idExhibition'] > 0) {
                 require_once dirname(__FILE__) . '/Dog.php';
                 $dog = new Dog();
                 $dog->setBreed('retriiver')->setGender('m')->setBirthDate('2000-12-21');
                 require_once dirname(__FILE__) . '/Exhibition.php';
                 $exhibition = new Exhibition();
                 $exhibition->setId($_GET['idExhibition']);
                 $exhibition->setCompleteExhibition();
                 $exhibition->insertDog($dog);
                 echo ParticipationView::buildMessage(array('dog' => $dog, 'exhibition' => $exhibition));
             } else {
                 echo ParticipationView::buildErrorMessage();
             }
             break;
         case 'showForm':
         default:
             require_once dirname(__FILE__) . '/Exhibition.php';
             $exhibitions = Exhibition::getListOfTypeExhibitions();
             require_once dirname(__FILE__) . '/ParticipationView.php';
             echo ParticipationView::buildRegistrationForm(array('exhibitions' => $exhibitions));
             break;
     }
 }
開發者ID:piiskop,項目名稱:pstk,代碼行數:29,代碼來源:index.php

示例2: dirname

require_once dirname(__FILE__) . '/Exhibition.php';
//lõin muutuja (mis on objekt) exhibition1, millel on omadused ja funktsioonid, mis on määratud klassis Exhibition
$exhibition1 = new Exhibition();
$exhibition1->setId(1);
$exhibition1->setLocation('Pärnu');
$exhibition1->setTimestamp('2015-12-30 09:00:00');
$exhibition2 = new Exhibition();
$exhibition2->setId(2);
$exhibition2->setLocation('Tallinn');
$exhibition2->setTimestamp('2015-12-20 10:00:00');
Exhibition::insertExhibition($exhibition1);
Exhibition::insertExhibition($exhibition2);
$exhibition1->setLocation('Tartu');
echo '<pre>';
var_dump(Exhibition::getExhibitions());
echo '</pre>';
require_once dirname(__FILE__) . '/Dog.php';
$dog1 = new Dog();
$dog1->setId(1);
$dog1->setBreed('retriiver');
$dog1->setBirthDate('2014-12-30 09:00:00');
$dog2 = new Dog();
$dog2->setId(2);
$dog2->setBreed('labrador');
$dog2->setBirthdate('2013-12-20 10:00:00');
//käivitatakse dog1 küljes olev funktsioon insert
$dog1->insert();
$dog2->insert();
echo '<pre>';
var_dump($_GET);
echo '</pre>';
開發者ID:piiskop,項目名稱:pstk,代碼行數:31,代碼來源:index.php


注:本文中的Dog::setBreed方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。