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


PHP Reference類代碼示例

本文整理匯總了PHP中Reference的典型用法代碼示例。如果您正苦於以下問題:PHP Reference類的具體用法?PHP Reference怎麽用?PHP Reference使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


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

示例1: isSatisfiedBy

 public function isSatisfiedBy(Reference $reference)
 {
     if ($reference->getIsCouple() == true) {
         return true;
     }
     return false;
 }
開發者ID:AlexEvesDeveloper,項目名稱:specification,代碼行數:7,代碼來源:CoupleSpecification.php

示例2: isSatisfiedBy

 public function isSatisfiedBy(Reference $reference)
 {
     if ($reference->getRentShare() <= 500) {
         return true;
     }
     return false;
 }
開發者ID:AlexEvesDeveloper,項目名稱:specification,代碼行數:7,代碼來源:RentShareSpecification.php

示例3: setList

 private function setList()
 {
     $name = 'Fortune 1000 (' . $this->year . ')';
     $list = Doctrine_Query::create()->from('LsList L')->where('L.name = ?', $name)->fetchOne();
     //if thlis year's fortune list doesn't already exist, create it
     if (!$list) {
         try {
             $this->db->beginTransaction();
             $list = new LsList();
             $list->name = $name;
             $list->description = "Fortune Magazine's list of the 1000 US companies with the largest published revenue figures.";
             $list->is_ranked = 1;
             $list->save();
             $this->list = $list;
             $ref = new Reference();
             $ref->object_model = 'LsList';
             $ref->object_id = $list->id;
             $ref->fields = 'name, description, is_ranked';
             $ref->source = 'http://money.cnn.com/magazines/fortune/fortune500/' . $this->year . '/full_list/';
             $ref->name = 'Fortune Magazine Online';
             $ref->save();
             if (!$this->testMode) {
                 $this->db->commit();
             }
         } catch (Exception $e) {
             $this->db->rollback();
             throw $e;
         }
     } else {
         $this->list = $list;
     }
 }
開發者ID:silky,項目名稱:littlesis,代碼行數:32,代碼來源:Fortune1000Scraper.class.php

示例4: isSatisfiedBy

 public function isSatisfiedBy(Reference $reference)
 {
     if ($reference->getStatus() == 'complete') {
         return true;
     }
     return false;
 }
開發者ID:AlexEvesDeveloper,項目名稱:specification,代碼行數:7,代碼來源:CompleteStatusSpecification.php

示例5: searchCrossRefDOI

 public static function searchCrossRefDOI($doi)
 {
     $doi = preg_replace('!\\s+!', ' ', $doi);
     $url = "http://api.crossref.org/works/" . $doi;
     $apiRequest = Yii::app()->curl->run($url);
     if ($apiRequest->hasErrors()) {
         throw new CHttpException(500, 'Gagal menghubungi server CrossRef');
     } else {
         $apiResponse = CJSON::decode($apiRequest->getData());
         if ($apiResponse === null) {
             throw new CHttpException(404, "Tidak ditemukan hasil dari CrossRef");
         }
         $refType = $apiResponse['message']['type'];
         $ref = new Reference();
         switch ($refType) {
             case 'journal-article':
                 return $ref->createJournal($apiResponse['message']);
             case 'proceedings-article':
                 return $ref->createProceeding($apiResponse['message']);
             case 'book-chapter':
                 return $ref->createBookChapter($apiResponse['message']);
             case 'reference-entry':
                 return $ref->createBookChapter($apiResponse['message']);
             default:
                 throw new CHttpException(404, "Tidak ditemukan hasil dari CrossRef");
         }
     }
 }
開發者ID:ardhimaarik,項目名稱:dapus-generator,代碼行數:28,代碼來源:WebAPI.php

示例6:

 /**
  * Swap this reference with another
  * @param \twhiston\twLib\Reference\Reference $point
  * @return mixed|null
  */
 public function &swap(Reference &$point)
 {
     $tmp =& $this->point;
     $pr =& $point->getRef();
     $this->reset($pr);
     $point->reset($tmp);
     return $tmp;
 }
開發者ID:twhiston,項目名稱:twlib,代碼行數:13,代碼來源:Reference.php

示例7: main

 /**
  * @throws BuildException
  */
 public function main()
 {
     $reffed = $this->reference !== null ? $this->reference->getReferencedObject($this->getProject()) : null;
     if ($reffed !== null && $reffed instanceof BuildException) {
         throw $reffed;
     }
     parent::main();
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:11,代碼來源:ThrowTask.php

示例8: setClasspathRef

 /**
  * Reference to a classpath to use when loading the files.
  *
  * @param Reference $r
  *
  * @throws BuildException
  */
 public function setClasspathRef(Reference $r)
 {
     if ($this->isReference()) {
         throw $this->tooManyAttributes();
     }
     $this->classpathId = $r->getRefId();
     $this->createClasspath()->setRefid($r);
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:15,代碼來源:Mapper.php

示例9: testAddDeveloperIdOnFirstWrite

	function testAddDeveloperIdOnFirstWrite() {
		$reference = new Reference();
		$reference->write();
		$this->assertEquals(
			$reference->DeveloperID,
			Member::currentUserID(),
			'Developer ID is automatically set on first write'
		);
	}
開發者ID:neopba,項目名稱:silverstripe-book,代碼行數:9,代碼來源:ReferenceTest.php

示例10: del

 function del()
 {
     $model = new Reference();
     $model->del();
     if ($_GET['parent'] != 0) {
         $this->redirect('/reference/' . $_GET['parent'] . '/');
     } else {
         $this->redirect('/reference/');
     }
 }
開發者ID:sov-20-07,項目名稱:billing,代碼行數:10,代碼來源:ReferenceController.php

示例11: testFromTemplate

 public function testFromTemplate()
 {
     $ref = Reference::fromTemplate('fake::mockup/index.html.twig');
     $this->assertEquals('fake::mockup/index.html.twig', $ref->getTemplateReference());
     $this->assertEquals('index.html', $ref->getShortReference());
     $this->assertEquals(0, $ref->getDepthLevel());
 }
開發者ID:ngodfraind,項目名稱:MockupBundle,代碼行數:7,代碼來源:ReferenceTest.php

示例12: dieOnCircularReference

 /**
  * Check to see whether any DataType we hold references to is
  * included in the Stack (which holds all DataType instances that
  * directly or indirectly reference this instance, including this
  * instance itself).
  *
  * If one is included, throw a BuildException created by circularReference
  *
  * This implementation is appropriate only for a DataType that
  * cannot hold other DataTypes as children.
  *
  * The general contract of this method is that it shouldn't do
  * anything if checked is true and set it to true on exit.
  *
  * @param         $stk
  * @param Project $p
  *
  * @return void
  *
  * @throws BuildException
  */
 public function dieOnCircularReference(&$stk, Project $p)
 {
     if ($this->checked || !$this->isReference()) {
         return;
     }
     $o = $this->ref->getReferencedObject($p);
     if ($o instanceof DataType) {
         // TESTME - make sure that in_array() works just as well here
         //
         // check if reference is in stack
         //$contains = false;
         //for ($i=0, $size=count($stk); $i < $size; $i++) {
         //    if ($stk[$i] === $o) {
         //        $contains = true;
         //        break;
         //    }
         //}
         if (in_array($o, $stk, true)) {
             // throw build exception
             throw $this->circularReference();
         } else {
             array_push($stk, $o);
             $o->dieOnCircularReference($stk, $p);
             array_pop($stk);
         }
     }
     $this->checked = true;
 }
開發者ID:TheTypoMaster,項目名稱:SPHERE-Framework,代碼行數:49,代碼來源:DataType.php

示例13: __construct

 /**
  * @return Reference
  */
 public function __construct(Tracker $tracker, $keyword)
 {
     $base_id = 0;
     $visibility = 'P';
     $is_used = 1;
     parent::__construct($base_id, $keyword, $GLOBALS['Language']->getText('project_reference', 'reference_art_desc_key') . ' - ' . $tracker->getName(), TRACKER_BASE_URL . '/?aid=$1&group_id=$group_id', $visibility, trackerPlugin::SERVICE_SHORTNAME, Tracker_Artifact::REFERENCE_NATURE, $is_used, $tracker->getGroupId());
 }
開發者ID:pombredanne,項目名稱:tuleap,代碼行數:10,代碼來源:Reference.php

示例14: getReference

 /**
  * @param string $label
  *
  * @return Reference|null
  */
 public function getReference($label)
 {
     $label = Reference::normalizeReference($label);
     if (isset($this->references[$label])) {
         return $this->references[$label];
     }
 }
開發者ID:colinodell,項目名稱:commonmark-php,代碼行數:12,代碼來源:ReferenceMap.php

示例15: get_file

 public function get_file($params = [])
 {
     $link_style = isset($params['link_style']) ? $params['link_style'] : 0;
     $reference = Reference::read_file($params['file_name'], $link_style);
     SiteStructure::set_page_title($reference['title']);
     Render::html($reference['content'], [], 'text/html');
 }
開發者ID:wileybenet,項目名稱:mobile-docs,代碼行數:7,代碼來源:reference_ctrl.php


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