User: zhaoquan Date: 15-6-4 Time: 下午4:35
Inheritance: extends Model
Example #1
0
	/**
	 * Sends an object to the queue.
	 *
	 * @param unknown_type $object
	 */
	public static function Send($queue, SimpleModel $object)
	{
		$queue=ObjectQueue::GetQueue($queue);
		
		$object->save($queue->domain, $queue->db);
		$queue->qmanager->send($queue->queue,$object->uid);
	}
Example #2
0
 /**
  * @test
  */
 public function shouldSubstituteParams()
 {
     //given
     $pdoStatement = Mock::mock();
     $pdo = Mock::mock();
     $db = Mock::mock('Ouzo\\Db');
     $db->_dbHandle = $pdo;
     Mock::when($pdo)->query(Mock::anyArgList())->thenReturn($pdoStatement);
     Mock::when($pdo)->quote("bob")->thenReturn("'bob'");
     Mock::when($pdoStatement)->fetchAll(Mock::anyArgList())->thenReturn(array());
     $modelQueryBuilder = new ModelQueryBuilder(SimpleModel::metaInstance(), $db);
     //when
     $modelQueryBuilder->where(array('name' => 'bob'))->options(array(Options::EMULATE_PREPARES => true))->fetchAll();
     //then
     Mock::verify($pdo)->query("SELECT simple_models.name AS _simple_models_name, simple_models.id AS _simple_models_id FROM simple_models WHERE name = 'bob'");
 }