This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| whereNested ( function ( $query ) | |
| { | |
| $query -> where ( 'year' , '>' , 2000 ); | |
| $query -> where ( 'year' , '<' , 2005 ); | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php namespace Parfetts\Services; | |
| class FileWriter | |
| { | |
| private | |
| $_fileObject; | |
| /** | |
| * @param $filename | |
| * @return void |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $return = $this->_client->search( | |
| array( | |
| 'index' => self::INDEX, | |
| 'type' => self::TYPE, | |
| 'body' => array( | |
| 'query' => array( | |
| 'bool' => array( | |
| 'must' => array( | |
| 'multi_match' => array( | |
| 'query' => $query, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add an item submitted via the app upload | |
| * | |
| * @param $packId | |
| * @param $quantity | |
| * @param $price | |
| * @param $trolleyId | |
| */ | |
| public function addFromApp($packId, $quantity, $price, $trolleyId) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $pdo = new \PDO('mysql:dbname=parfetts;host=localhost', '', ''); | |
| $pdo->beginTransaction(); | |
| $statement = $pdo->prepare("INSERT INTO trolley_items ( `trolley_id`,`pack_id`,`price`,`quantity` ) | |
| VALUES | |
| ( ?, ?, ?, ? ) | |
| ON DUPLICATE KEY UPDATE `quantity` = `quantity` + 1"); | |
| $statement->execute(array($trolleyId, $packId, $price, $quantity)); | |
| $pdo->commit(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add an item submitted via the app upload | |
| * | |
| * @param array $items An array of items for adding to the Trolley | |
| */ | |
| public function addFromApp($items) | |
| { | |
| $pdo = DB::getPdo(); | |
| $pdo->beginTransaction(); | |
| $statement = $pdo->prepare("INSERT INTO trolley_items ( `trolley_id`,`pack_id`,`price`,`quantity` ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add an item submitted via the app upload | |
| * | |
| * @param array $items An array of items for adding to the Trolley | |
| * @return void | |
| */ | |
| public function addFromApp($items) | |
| { | |
| $pdo = DB::getPdo(); | |
| $pdo->beginTransaction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add an item submitted via the app upload | |
| * | |
| * @param array $items An array of items for adding to the Trolley | |
| * @return void | |
| */ | |
| public function addFromApp($items) | |
| { | |
| $pdo = DB::getPdo(); | |
| $pdo->beginTransaction(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Add multiple items (used for opticon app upload) | |
| * | |
| * @param array $data | |
| * @return array $feedback | |
| */ | |
| public function addMultipleItems($data) | |
| { | |
| $branchId = $this->_customer->getBranchId(); | |
| $trolleyId = $this->_trolleyRepository->findIdByCustomerId($this->_customer->getId()); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --skip-syslog | |
| --log-error=/var/log/mysqld.log | |
| --pid-file=/var/run/mysqld/mysqld.pid |