Skip to content

Instantly share code, notes, and snippets.

/**
* 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();
/**
* 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();
/**
* 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` )
$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();
/**
* Add an item submitted via the app upload
*
* @param $packId
* @param $quantity
* @param $price
* @param $trolleyId
*/
public function addFromApp($packId, $quantity, $price, $trolleyId)
{
$return = $this->_client->search(
array(
'index' => self::INDEX,
'type' => self::TYPE,
'body' => array(
'query' => array(
'bool' => array(
'must' => array(
'multi_match' => array(
'query' => $query,
<?php namespace Parfetts\Services;
class FileWriter
{
private
$_fileObject;
/**
* @param $filename
* @return void
whereNested ( function ( $query )
{
$query -> where ( 'year' , '>' , 2000 );
$query -> where ( 'year' , '<' , 2005 );
})
<?php
/**
* SplClassLoader implementation that implements the technical interoperability
* standards for PHP 5.3 namespaces and class names.
*
* http://groups.google.com/group/php-standards/web/final-proposal
*
* // Example which loads classes for the Doctrine Common package in the
* // Doctrine\Common namespace.
@rsmarshall
rsmarshall / boxfile
Created July 10, 2012 11:51
irealms boxfile
web1: #component type & number
name: irealms-pyrocms #component settings
shared_writable_dirs:
- /system/cms/cache/
- /system/cms/logs/
- /uploads/
php_extensions:
- mysql
- gd
- curl