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


PHP State类代码示例

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


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

示例1: getState

 /**
  * For listing the State
  * @author        Praveen Singh
  * @method        getState
  * @param         id
  * @return        one row of Module Role table 
  * @since         version 0.0.1
  * @version       0.2.9
  */
 function getState($statId)
 {
     App::import("Model", "State");
     $model = new State();
     $datas = $model->find("first", array('conditions' => array('State.id' => $statId)));
     return $datas;
 }
开发者ID:praveensingh25000,项目名称:Bivid,代码行数:16,代码来源:CommonHelper.php

示例2: parseRequest

 public function parseRequest()
 {
     // init the state library
     $state = new State();
     // get the request
     $request = $state->getInput('request');
     if (!empty($request)) {
         // explode request
         $request_array = explode('/', $request);
         if (!empty($request_array)) {
             // store the controller
             $this->controller = $request_array[0];
         }
         if (isset($request_array[1])) {
             // store the action
             $this->action = $request_array[1];
         }
         if (count($request_array) > 2) {
             // foreach extra key
             for ($i = 2; $i < count($request_array); $i++) {
                 // store as a param
                 $this->params[$i - 2] = $request_array[$i];
             }
         }
     }
 }
开发者ID:aboxall,项目名称:Framework,代码行数:26,代码来源:route.php

示例3: __construct

 public function __construct($legislation_id = 0)
 {
     parent::__construct('legislation', $legislation_id);
     if ($legislation_id) {
         $state = new State($this->region_id());
         $logo = LOGO_PATH . strtolower('state_' . $state->state_abbr() . '_' . $this->current_chamber()) . '.png';
         $location = $state->state_name() . ' State ' . $this->current_chamber();
         list($category_id, $category_name) = Category::legislation_get_category($this->current_location());
         $committee = Category::get_location($this->current_location());
         $this->legislator_ids = $this->get_legislator_ids();
         $legislators = array();
         if (!empty($this->legislator_ids)) {
             foreach ($this->legislator_ids as $id) {
                 $legislators[] = new Legislator($id);
             }
         }
         $this->sponsors = Legislation::get_legislator_data($legislators, $committee);
         $this->bill = $this->_extract_bill_id();
         $this->image = $logo;
         $this->bill_location = $location;
         $this->location_description = $committee;
         $this->category = array('id' => $category_id, 'name' => $category_name);
         $this->status = new Status($this->status_id());
         $this->date_introduced_parts = get_date_parts($this->date_introduced());
         $this->date_heard_parts = get_date_parts($this->date_heard());
         $this->_get_public_opinion();
         $this->comment_data = $this->get_comment_data();
     }
 }
开发者ID:rtoews,项目名称:meocracy,代码行数:29,代码来源:class.legislation.php

示例4: getIdentifier

 /**
  * Returns event identifier
  *
  * @return string
  */
 public function getIdentifier()
 {
     if (!$this->identifier) {
         $this->identifier = sha1(microtime(true) . implode('', $this->tags) . State::getTestSuiteName() . State::getTestClassName() . State::getTestMethodName() . $this->state->getPageUrl());
     }
     return $this->identifier;
 }
开发者ID:Mohitsahu123,项目名称:mtf,代码行数:12,代码来源:Event.php

示例5: displayData

 function displayData()
 {
     $cityTemp = CityManager::getSingleCity('id', $this->church->getIdCity());
     if ($cityTemp === NULL) {
         $cityTemp = new City();
     }
     $stateTemp = CityManager::getSingleState('id', $cityTemp->getIdState());
     $cityString = "*************************";
     if ($stateTemp === NULL) {
         $stateTemp = new State();
     } else {
         $cityString = $cityTemp->getName() . ", " . $stateTemp->getShortName();
     }
     $this->SetFont('Arial', 'B', 10);
     $cellSizeY = 5;
     for ($i = 0; $i < 3; $i++) {
         //Get the data necesary of create the document
         $this->SetXY($x + 100, $i * 60 + $y + 40 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getName()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 47 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $this->church->getAddress()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 54 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', 'CP. ' . $this->church->getPostalCode()), 0, 0, 'C');
         $this->SetXY($x + 100, $i * 60 + $y + 61 - $cellSizeY);
         $this->Cell(80, $cellSizeY, iconv('utf-8', 'cp1252', $cityString), 0, 0, 'C');
     }
 }
开发者ID:jonatalamantes,项目名称:NotariusAdOmnes,代码行数:27,代码来源:EnvelopeChurch.php

示例6: testPersist

 public function testPersist()
 {
     $model = new State($this->config, $this->writer);
     $constraint = new \PHPUnit_Framework_Constraint_IsInstanceOf('Magento\\Framework\\App\\Cache\\Type\\ConfigSegment');
     $this->writer->expects($this->once())->method('update')->with($constraint);
     $model->persist();
 }
开发者ID:,项目名称:,代码行数:7,代码来源:

示例7: handleException

 /**
  * Handle exception
  *
  * @param \Exception $e
  * @return void
  */
 protected function handleException($e)
 {
     $needToMaskDisplayMessage = !$e instanceof \Magento\Framework\Exception\LocalizedException && $this->appState->getMode() != State::MODE_DEVELOPER;
     $displayMessage = $needToMaskDisplayMessage ? (string) new \Magento\Framework\Phrase('An error occurred while processing your request') : $e->getMessage();
     $this->messageManager->addError($displayMessage);
     $this->logger->critical($e->getMessage());
 }
开发者ID:opexsw,项目名称:magento2,代码行数:13,代码来源:FrontController.php

示例8: cloneState

 public static function cloneState(State &$state)
 {
     $instance = new State($state->getStream());
     foreach ($state as $char) {
         $instance->appendChar($char);
     }
     return $instance;
 }
开发者ID:ivansky,项目名称:php-dom-query,代码行数:8,代码来源:State.php

示例9: testGetMetadata

 public function testGetMetadata()
 {
     $state = new State('stateName', ['param1' => 'value1', 'param2' => 'value2']);
     $this->assertEquals(['param1' => 'value1', 'param2' => 'value2'], $state->getMetadata());
     $this->assertEquals('value1', $state->getMetadata('param1'));
     $this->assertEquals('value2', $state->getMetadata('param2'));
     $this->assertEquals(null, $state->getMetadata('UNEXISTED_KEY'));
 }
开发者ID:sokil,项目名称:php-state,代码行数:8,代码来源:StateTest.php

示例10: stateShouldKeepItemsByRuleNumberAndPosition

 /**
  * @test
  */
 public function stateShouldKeepItemsByRuleNumberAndPosition()
 {
     $item1 = new Item(new Rule(1, 'E', array('E', '+', 'T')), 0);
     $state = new State(0, array($item1));
     $this->assertSame($item1, $state->get(1, 0));
     $item2 = new Item(new Rule(2, 'T', array('T', '+', 'F')), 0);
     $state->add($item2);
     $this->assertSame($item2, $state->get(2, 0));
 }
开发者ID:MPV,项目名称:AspectMock-test,代码行数:12,代码来源:StateTest.php

示例11: valuesFromForm

 function valuesFromForm(&$values, State $record)
 {
     if ($values['_is_disabled']) {
         $values['tag'] = $values['tag'] ? $values['tag'] * -1 : -1;
     }
     if (!$record->pk()) {
         $values['state'] = $this->country . '-' . $values['state'];
     }
 }
开发者ID:grlf,项目名称:eyedock,代码行数:9,代码来源:AdminStatesController.php

示例12: exec

 /**
  * Execute SampleData module installation.
  * Catch exception if it appeared and continue installation
  *
  * @param InstallerInterface $installer
  * @return void
  */
 public function exec(InstallerInterface $installer)
 {
     try {
         $this->appState->emulateAreaCode('setup', [$installer, 'install']);
         $this->state->setInstalled();
     } catch (\Exception $e) {
         $this->state->setError();
         $this->logger->error('Sample Data error: ' . $e->getMessage());
     }
 }
开发者ID:kidaa30,项目名称:magento2-platformsh,代码行数:17,代码来源:Executor.php

示例13: getStateList

 function getStateList($countryCode)
 {
     App::import("Model", "State");
     $model = new State();
     $con2 = $model->find('list', array('fields' => array('State.id', 'State.statename'), 'conditions' => array('State.countryid' => $countryCode)));
     if (empty($con2)) {
         return 0;
     } else {
         return $con2;
     }
 }
开发者ID:abhilashjaiswal,项目名称:hrportal,代码行数:11,代码来源:CommonComponent.php

示例14: takeChildFromDOM

 /**
  * Creates individual Entry objects of the appropriate type and
  * stores them as members of this entry based upon DOM data.
  *
  * @param DOMNode $child The DOMNode to process
  */
 protected function takeChildFromDOM($child)
 {
     $absoluteNodeName = $child->namespaceURI . ':' . $child->localName;
     switch ($absoluteNodeName) {
         case $this->lookupNamespace('yt') . ':' . 'state':
             $state = new State();
             $state->transferFromDOM($child);
             $this->_state = $state;
             break;
         default:
             parent::takeChildFromDOM($child);
             break;
     }
 }
开发者ID:rexmac,项目名称:zf2,代码行数:20,代码来源:Control.php

示例15: get

 /**
  * Returns the state with the given id. If no such state exists, a new
  * state is returned.
  */
 function get($_id)
 {
     $_id = 'x';
     $state = new State();
     $state->id = $_id;
     if (!is_readable($this->_filename_of($_id))) {
         return $state;
     }
     $pairs = parse_ini_file($this->_filename_of($_id));
     foreach ($pairs as $key => $value) {
         $state->set($key, $value);
     }
     return $state;
 }
开发者ID:useada,项目名称:freech-1,代码行数:18,代码来源:statedb.class.php


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