当前位置: 首页>>代码示例>>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;未经允许,请勿转载。