本文整理汇总了PHP中Reference类的典型用法代码示例。如果您正苦于以下问题:PHP Reference类的具体用法?PHP Reference怎么用?PHP Reference使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Reference类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: setRefid
/**
* @param Reference $r
*
* @throws BuildException
*/
public function setRefid(Reference $r)
{
if (count($this->parameters) !== 0 || $this->className !== null) {
throw $this->tooManyAttributes();
}
$o = $r->getReferencedObject($this->getProject());
if ($o instanceof PhingFilterReader) {
$this->setClassName($o->getClassName());
$this->setClasspath($o->getClassPath());
foreach ($o->getParams() as $p) {
$this->addParam($p);
}
} else {
$msg = $r->getRefId() . " doesn\\'t refer to a PhingFilterReader";
throw new BuildException($msg);
}
parent::setRefid($r);
}
开发者ID:TheTypoMaster,项目名称:SPHERE-Framework,代码行数:23,代码来源:PhingFilterReader.php
示例17: jsonAction
public function jsonAction()
{
$this->_helper->viewRenderer->setNoRender();
$db_params = OpenContext_OCConfig::get_db_config();
$db = new Zend_Db_Adapter_Pdo_Mysql($db_params);
$db->getConnection();
$requestParams = $this->_request->getParams();
$host = App_Config::getHost();
$reference = new Reference();
$reference->initialize($requestParams);
if ($reference->get_refs()) {
header('Content-Type: application/json; charset=utf8');
//echo Zend_Json::encode($reference->placeTokens);
echo Zend_Json::encode($reference->tmPlaces);
} else {
$this->view->requestURI = $this->_request->getRequestUri();
return $this->render('404error');
}
}
开发者ID:shawngraham,项目名称:gap2,代码行数:19,代码来源:SnippetsController.php
示例18: addReference
/**
* adds a reference track from an object to another if that reference does not already exist
* expects objects or arrays in the form array(id, 'ModelName')
*/
public static function addReference($mFromObject, $mToObject)
{
if ($mFromObject instanceof BaseObject && $mFromObject->isNew()) {
self::$aUnsavedReferences[] = array($mFromObject, $mToObject);
return;
}
self::prepareObjectArgument($mFromObject);
self::prepareObjectArgument($mToObject);
if (self::referenceExists($mFromObject, $mToObject)) {
return;
}
$oReference = new Reference();
$oReference->setFromId($mFromObject[0]);
$oReference->setFromModelName($mFromObject[1]);
$oReference->setToId($mToObject[0]);
$oReference->setToModelName($mToObject[1]);
try {
$oReference->save();
} catch (PropelException $ex) {
if ($ex->getCause() instanceof NotPermittedException) {
//Silently discard NotPermittedException because the FromObject won’t be saved either
} else {
throw $ex;
}
}
}
开发者ID:rapila,项目名称:cms-base,代码行数:30,代码来源:ReferencePeer.php
示例19: do_create
function do_create()
{
global $feedback;
$request =& HTTPRequest::instance();
// Sanity check
if (!$request->get('group_id') || !$request->get('keyword') || !$request->get('link')) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'missing_parameter'));
}
$force = $request->get('force');
if (!user_is_super_user()) {
$force = false;
}
$reference_manager =& ReferenceManager::instance();
if ($request->get('service_short_name') == 100) {
// none
$service_short_name = "";
} else {
$service_short_name = $request->get('service_short_name');
}
$ref = new Reference(0, $request->get('keyword'), $request->get('description'), $request->get('link'), $request->get('scope'), $service_short_name, $request->get('nature'), $request->get('is_used'), $request->get('group_id'));
if ($ref->getGroupId() == 100 && $ref->isSystemReference()) {
// Add reference to ALL active projects!
$result = $reference_manager->createSystemReference($ref, $force);
if (!$result) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'create_fail'));
} else {
$feedback .= " " . $GLOBALS['Language']->getText('project_reference', 'system_r_create_success');
}
} else {
$result = $reference_manager->createReference($ref, $force);
if (!$result) {
exit_error($GLOBALS['Language']->getText('global', 'error'), $GLOBALS['Language']->getText('project_reference', 'create_fail'));
} else {
$feedback .= " " . $GLOBALS['Language']->getText('project_reference', 'r_create_success') . " ";
}
}
}
开发者ID:pombredanne,项目名称:tuleap,代码行数:37,代码来源:ReferenceAdministrationActions.class.php
示例20: getCheckedRef
/**
* Performs the check for circular references and returns the referenced object.
*
* @param $requiredClass
* @param $dataTypeName
*
* @throws BuildException
*
* @return mixed
*/
public function getCheckedRef($requiredClass, $dataTypeName)
{
if (!$this->checked) {
// should be in stack
$stk = array();
$stk[] = $this;
$this->dieOnCircularReference($stk, $this->getProject());
}
$o = $this->ref->getReferencedObject($this->getProject());
if (!$o instanceof $requiredClass) {
throw new BuildException($this->ref->getRefId() . " doesn't denote a " . $dataTypeName);
} else {
return $o;
}
}
开发者ID:Geeklog-Japan,项目名称:geeklog-japan,代码行数:25,代码来源:DataType.php
注:本文中的Reference类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论