本文整理汇总了PHP中Store类的典型用法代码示例。如果您正苦于以下问题:PHP Store类的具体用法?PHP Store怎么用?PHP Store使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Store类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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";
}
示例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')));
}
示例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;
}
示例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);
}
示例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());
}
示例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));
}
示例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'));
}
示例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());
}
示例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);
}
示例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);
}
示例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);
}
示例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;
}
示例13: getInstance
public static function getInstance()
{
if (!isset(self::$instance)) {
self::$instance = new Store();
}
return self::$instance;
}
示例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);
*/
}
示例15: 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);
}