• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Store类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: addEvent

 private function addEvent($type, $id, $email, $datetime)
 {
     echo 'Adding ' . strtoupper($type) . ' to campaign ' . $id . ' with date of ' . $datetime . ' and email of ' . $email . "\r\n";
     $StoreModel = new Store();
     $encryptedEmail = $StoreModel->encryptEmail($email);
     // Look for this email address in store table
     $StoreRows = Store::model()->with('store2contact')->findAll(array('condition' => 'email = :email', 'params' => array(':email' => $encryptedEmail)));
     // collect our warehouse_ids up to match in campaign_contact table.
     $warehouseIDs = [];
     if (sizeof($StoreRows)) {
         // Save 1 suppression row for every instance of the email address in the store table - use store_id
         foreach ($StoreRows as $Store) {
             if ($Store->store2contact != null) {
                 $warehouseIDs[] = $Store->store2contact->contact_warehouse_id;
             }
         }
         $Contacts = null;
         // check for contact
         if (sizeof($warehouseIDs) && is_numeric($id)) {
             //Bounces
             if ($type === 'bounce') {
                 $Contacts = CampaignContact::model()->updateAll(array('bounced' => $datetime), "campaign_id = :campaign_id AND warehouse_id IN (" . implode(',', $warehouseIDs) . ") AND bounced IS NULL", array(':campaign_id' => $id));
             } else {
                 $Contacts = CampaignContact::model()->updateAll(array('opened' => $datetime), "campaign_id = :campaign_id AND warehouse_id IN (" . implode(',', $warehouseIDs) . ") AND opened IS NULL", array(':campaign_id' => $id));
             }
         }
         echo 'Updated ' . sizeof($Contacts) . ' contact';
     } else {
         echo 'Campaign contact not found' . "\r\n";
     }
     echo "\r\n";
 }
开发者ID:newga,项目名称:newga,代码行数:32,代码来源:legacyCampaignEventsCommand.php


示例2: testDumpJson

 public function testDumpJson()
 {
     $store = new Store();
     $store->push(__DIR__ . '/data/php.ini');
     unset($store['Session']);
     $this->assertEquals($store->dump(), (array) json_decode($store->dump('json')));
 }
开发者ID:ercling,项目名称:keyvaluestore,代码行数:7,代码来源:StoreTest.php


示例3: select_value

    function select_value($pool_uri, $value, $pool_size)
    {
        if (!isset($this->bigfootMetabox)) {
            $bigfoot = new Store(STORE_URI);
            $this->bigfootMetabox = $bigfoot->get_metabox();
        }
        $changeset = '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
    xmlns:cs="http://purl.org/vocab/changeset/schema#">
  <cs:ChangeSet>
    <cs:subjectOfChange rdf:resource="' . $pool_uri . '"/>
    <cs:creatorName>pool</cs:creatorName>
    <cs:changeReason>Selecting key</cs:changeReason>
    <cs:removal>
      <rdf:Statement>
        <rdf:subject rdf:resource="' . $pool_uri . '"/>
        <rdf:predicate rdf:resource="http://purl.org/vocab/value-pools/schema#value"/>
        <rdf:object>' . $value . '</rdf:object>
      </rdf:Statement>
    </cs:removal>
    <cs:addition>
      <rdf:Statement>
        <rdf:subject rdf:resource="' . $pool_uri . '"/>
        <rdf:predicate rdf:resource="http://purl.org/vocab/value-pools/schema#value"/>
        <rdf:object>' . ($pool_size + $value) . '</rdf:object>
      </rdf:Statement>
    </cs:addition>
  </cs:ChangeSet>
</rdf:RDF>';
        $response = $this->bigfootMetabox->apply_changeset_rdfxml($changeset);
        // echo "<pre>";
        // echo htmlspecialchars(print_r($response, true));
        // echo "</pre>";
        return true;
    }
开发者ID:risis-eu,项目名称:RISIS_LinkedDataAPI,代码行数:34,代码来源:valuepool.class.php


示例4: getSharedNoteStore

 public function getSharedNoteStore($linkedNotebook)
 {
     $noteStoreUrl = $linkedNotebook->noteStoreUrl;
     $noteStore = new Store($this->token, '\\EDAM\\NoteStore\\NoteStoreClient', $noteStoreUrl);
     $sharedAuth = $noteStore->authenticateToSharedNotebook($linkedNotebook->shareKey);
     $sharedToken = $sharedAuth->authenticationToken;
     return new Store($sharedToken, '\\EDAM\\NoteStore\\NoteStoreClient', $noteStoreUrl);
 }
开发者ID:slowmotion,项目名称:readerself,代码行数:8,代码来源:Client.php


示例5: testRootNode

 public function testRootNode()
 {
     $store = new Store($this->getSession(), "SpacesStore");
     $root = $store->rootNode;
     $this->assertNotNull($root, "root node unexpectedly null");
     $this->assertNotNull($root->id, "root node id unexpectedly null");
     $this->assertEquals($store->__toString(), $root->store->__toString());
 }
开发者ID:negabaro,项目名称:alfresco,代码行数:8,代码来源:StoreTest.php


示例6: actionAdmin

 public function actionAdmin()
 {
     $model = new Store('search');
     $model->unsetAttributes();
     if (isset($_GET['Store'])) {
         $model->setAttributes($_GET['Store']);
     }
     $this->render('admin', array('model' => $model));
 }
开发者ID:schmunk42,项目名称:yii-sakila-crud,代码行数:9,代码来源:StoreController.php


示例7: testMerge

 /** @dataProvider dataMerge */
 public function testMerge($mode, $newBarValue)
 {
     $store = new Store(':');
     $store->set('foo:bar', 'baz');
     $mergeData = ['foo' => ['bar' => 'quux', 'fizz' => 'buzz']];
     $store->merge($mergeData, $mode);
     self::assertEquals($newBarValue, $store->get('foo:bar'));
     self::assertEquals('buzz', $store->get('foo:fizz'));
 }
开发者ID:ulrichsg,项目名称:phconf,代码行数:10,代码来源:StoreTest.php


示例8: testDelete

 function testDelete()
 {
     $name = "Zelds";
     $test_store = new Store($name);
     $test_store->save();
     $name = "Granite";
     $test_brand = new Brand($name);
     $test_brand->save();
     $test_brand->addStore($test_brand);
     $test_brand->delete();
     $this->assertEquals([], $test_brand->getStores());
 }
开发者ID:alexMcosta,项目名称:Shoes_Brands,代码行数:12,代码来源:BrandTest.php


示例9: test_getStoreName

 function test_getStoreName()
 {
     //arrange
     $store_name = "Payless";
     $id = 1;
     $test_Store = new Store($store_name, $id);
     //act
     $result = $test_Store->getStoreName();
     //assert
     $this->assertEquals($store_name, $result);
     //for debugging
     var_dump($test_Store);
 }
开发者ID:julianstewart,项目名称:shoe_store,代码行数:13,代码来源:StoreTest.php


示例10: save

 function save($object = '', $related_field = '')
 {
     if (!$this->exists()) {
         $o = new Store();
         $o->select_max('position');
         $o->get();
         if (count($o->all) != 0) {
             $max = $o->position + 1;
             $this->position = $max;
         } else {
             $this->postion = 1;
         }
     }
     return parent::save($object, $related_field);
 }
开发者ID:lxthien,项目名称:batdongsan,代码行数:15,代码来源:store.php


示例11: edit

 public function edit($id)
 {
     $param['pageNo'] = 3;
     $param['agent'] = AgentModel::find($id);
     $param['stores'] = StoreModel::where('company_id', Session::get('company_id'))->get();
     return View::make('company.agent.edit')->with($param);
 }
开发者ID:victory21th,项目名称:QM-Laravel,代码行数:7,代码来源:AgentController.php


示例12: authenticate

 /**
  * Authenticates a user.
  * The example implementation makes sure if the username and password
  * are both 'demo'.
  * In practical applications, this should be changed to authenticate
  * against some persistent user identity storage (e.g. database).
  * @return boolean whether authentication succeeds.
  */
 public function authenticate()
 {
     $result = Managers::model()->find('name=? and is_quit=?', array($this->username, "0"));
     if ($result) {
         if ($result->password == md5($this->username . md5($this->password))) {
             $this->_id = $result->id;
             $this->errorCode = self::ERROR_NONE;
             $token = md5($result->id . $this->password);
             //Yii::app()->cache_redis->set($result->id.'.UserToken',$token);
             $store = Store::model()->findAll('manager=:id', array(':id' => $result->id));
             $store_ids = array();
             if ($store) {
                 foreach ($store as $key => $val) {
                     $store_ids[] = $val->id;
                 }
             }
             Yii::app()->user->setState('token', $token);
             Yii::app()->user->setState('info', $result);
             Yii::app()->user->setState('store', $store);
             Yii::app()->user->setState('store_ids', $store_ids);
         } else {
             $this->errorCode = self::ERROR_PASSWORD_INVALID;
         }
     } else {
         $this->errorCode = self::ERROR_USERNAME_INVALID;
     }
     return !$this->errorCode;
 }
开发者ID:kl0428,项目名称:admin,代码行数:36,代码来源:UserIdentity.php


示例13: getInstance

 public static function getInstance()
 {
     if (!isset(self::$instance)) {
         self::$instance = new Store();
     }
     return self::$instance;
 }
开发者ID:alterfw,项目名称:hero,代码行数:7,代码来源:Store.php


示例14: run

 public function run($args)
 {
     exit('Disabled');
     $Stores = Store::model()->with('organisation')->findAll();
     foreach ($Stores as $Store) {
         if (strlen($Store->email)) {
             print $Store->first_name . ',' . $Store->last_name . ',' . $Store->email . ',' . $Store->organisation->title . ',' . $this->getEmailPrefs($Store->contact_email) . "\r\n";
             //print $Store->last_name . "\n";
             //print $Store->address_line_1 . "\n\n\n";
             //print $Store->phone . "\n\n\n";
             //print $Store->mobile . "\n\n\n";
         }
     }
     exit;
     /*
     $StoreModel = new Store;
     $email = $StoreModel->encryptEmail($email);
     
     $Store = Store::model()->findAll(array(
     	
     	'condition' => 'email = :email',
     	'params' => array(
     		':email' => $email,
     	),
     	
     ));
     
     print_r($Store);
     */
 }
开发者ID:newga,项目名称:newga,代码行数:30,代码来源:storeTestCommand.php


示例15: initialize

 public static function initialize($path)
 {
     Config::setPath($path . 'config/');
     self::$request = Request::instance();
     self::$config = Config::instance();
     self::$store = Store::instance();
 }
开发者ID:erkie,项目名称:cowl,代码行数:7,代码来源:current.php


示例16: testFactory

 public function testFactory()
 {
     $this->assertInstanceOf('Store_Local', Store::factory());
     $this->assertInstanceOf('Store_Local', Store::factory(Store::Local));
     $this->assertInstanceOf('Store_Session', Store::factory(Store::Session));
     $this->assertEquals(false, Store::factory('Undefined type'));
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:7,代码来源:StoreTest.php


示例17: testAdd

 /**
  * @covers QueueController::Add
  * @todo Implement testAdd().
  */
 public function testAdd()
 {
     $person = Person::factory('adult');
     $person->name = 'Poehavshiy';
     $person->add();
     $store = Store::factory('Grocery');
     $store->name = 'Prison';
     $store->add();
     $product = new Product();
     $product->name = 'Sladkiy hleb';
     $product->add();
     $request = Application::getInstance()->request;
     $request->setParams(array('storeId' => $store->id, 'personId' => $person->id, 'product_' . $product->id => 'on'));
     $personId = $request->p('personId');
     $storeId = $request->p('storeId');
     $store = Store::get($storeId);
     $person = Person::get($personId);
     $store->queue->add($person);
     $person->basket->drop();
     $name = 'product_' . $product->id;
     $value = $product;
     if (preg_match_all('/^product_(\\d+)$/', $name, $matches)) {
         $person->basket->add(Product::get($matches[1][0]));
     }
 }
开发者ID:ruyozora,项目名称:Test-test,代码行数:29,代码来源:QueueControllerTest.php


示例18: save

 /**
  * 
  * Salva los datos con el nombre y ruta especificado
  * 
  * $this->getStore()
  *               ->getExporter()
  *               ->setEntities(array(
  *                   '\examples\exampleBundle\Model\Entity\Persona'
  *               ))
  *               ->save(__DIR__ . '/exportExample.php');
  * 
  * @param string $file nombre del archivo a salvar con los datos
  */
 public function save($file)
 {
     $definition = array();
     foreach ($this->entities as $entity) {
         $meta = $this->store->getManager()->getMetadataFactory()->getMetadataFor($entity);
         $table = $meta->getTableName();
         $association = $meta->associationMappings;
         foreach ($association as $map) {
             if (isset($map['joinTable']) and isset($map['joinTable']['name'])) {
                 $mapTable = $map['joinTable']['name'];
                 if (!isset($definition[$mapTable])) {
                     $resultmap = $this->store->getManager()->getConnection()->executeQuery("SELECT * FROM {$mapTable}");
                     $definition[$mapTable] = $resultmap->fetchAll(\PDO::FETCH_ASSOC);
                 }
             }
         }
         $result = $this->store->getManager()->getConnection()->executeQuery("SELECT * FROM {$table}");
         $definition[$table] = $result->fetchAll(\PDO::FETCH_ASSOC);
     }
     foreach ($this->tables as $table) {
         $result = $this->store->getManager()->getConnection()->executeQuery("SELECT * FROM {$table}");
         $definition[$table] = $result->fetchAll(\PDO::FETCH_ASSOC);
     }
     $time = date("F d Y h:i:s A");
     file_put_contents($file, "<?php\n /**\n  * THIS FILE IS GENERATED BY RAPTOR EXPORTER, TO EASLY UPLOAD THIS FILE AGAIN INTO THE \n  * DATABASE USE THE IMPORTER CLASS.\n  * \n  * Generated {$time}\n  */\n \n\$create=" . var_export($this->entities, true) . ";\n\$data=" . var_export($definition, true) . ";\n\n");
 }
开发者ID:williamamed,项目名称:Raptor2,代码行数:39,代码来源:Exporter.php


示例19: testSetData

 public function testSetData()
 {
     $store = Store::factory(Store::Local, 'test');
     $store->set('key', 'val');
     $data = array('key2' => 'val2', 'key3' => 'val3');
     $store->setData($data);
     $this->assertEquals($data, $store->getData());
 }
开发者ID:vgrish,项目名称:dvelum,代码行数:8,代码来源:LocalTest.php


示例20: process

 public function process(array $case)
 {
     // Allows for data to be re-read from the DB instead of being fetched
     // from the store-id-cache
     if (isset($case['store']['clear-cache']) && $case['store']['clear-cache']) {
         $this->store->clear();
     }
     $this->assertRdfOutputForCase($case);
 }
开发者ID:jongfeli,项目名称:SemanticMediaWiki,代码行数:9,代码来源:RdfTestCaseProcessor.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP StoreQuery类代码示例发布时间:2022-05-23
下一篇:
PHP StorageProfilePeer类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap