118 lines
3.2 KiB
PHP
118 lines
3.2 KiB
PHP
<?php
|
|
/**
|
|
* PrintshopCreator Suite
|
|
*
|
|
* PHP Version 5.3
|
|
*
|
|
* @author Thomas Peterson <info@thomas-peterson.de>
|
|
* @copyright 2012-2013 PrintshopCreator GmbH
|
|
* @license Private
|
|
* @link http://www.printshopcreator.de
|
|
*/
|
|
namespace PSC\Library\Calc\Tests\Mock;
|
|
|
|
use Doctrine\Common\Persistence\ObjectRepository;
|
|
|
|
class PaperRepostory implements ObjectRepository
|
|
{
|
|
|
|
/**
|
|
* Finds an object by its primary key / identifier.
|
|
*
|
|
* @param mixed $id The identifier.
|
|
*
|
|
* @return object The object.
|
|
*/
|
|
public function find($id)
|
|
{
|
|
// TODO: Implement find() method.
|
|
}
|
|
|
|
/**
|
|
* Finds all objects in the repository.
|
|
*
|
|
* @return array The objects.
|
|
*/
|
|
public function findAll()
|
|
{
|
|
// TODO: Implement findAll() method.
|
|
}
|
|
|
|
/**
|
|
* Finds objects by a set of criteria.
|
|
*
|
|
* Optionally sorting and limiting details can be passed. An implementation may throw
|
|
* an UnexpectedValueException if certain values of the sorting or limiting details are
|
|
* not supported.
|
|
*
|
|
* @param array $criteria
|
|
* @param array|null $orderBy
|
|
* @param int|null $limit
|
|
* @param int|null $offset
|
|
*
|
|
* @return array The objects.
|
|
*
|
|
* @throws \UnexpectedValueException
|
|
*/
|
|
public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
|
|
{
|
|
// TODO: Implement findBy() method.
|
|
}
|
|
|
|
/**
|
|
* Finds a single object by a set of criteria.
|
|
*
|
|
* @param array $criteria The criteria.
|
|
*
|
|
* @return object The object.
|
|
*/
|
|
public function findOneBy(array $criteria)
|
|
{
|
|
$papier = array();
|
|
$papier['bdm135'] = new Paper();
|
|
$papier['bdm135']->setArtNr('bdm135');
|
|
$papier['bdm135']->setDescription1('Bilderdruck matt 135 gr');
|
|
|
|
$papier['bdg135'] = new Paper();
|
|
$papier['bdg135']->setArtNr('bdg135');
|
|
$papier['bdg135']->setDescription1('Bilderdruck glänzend 135 gr');
|
|
|
|
$papier['bdm170'] = new Paper();
|
|
$papier['bdm170']->setArtNr('bdm170');
|
|
$papier['bdm170']->setDescription1('Bilderdruck matt 170 gr');
|
|
|
|
$papier['bdg170'] = new Paper();
|
|
$papier['bdg170']->setArtNr('bdg170');
|
|
$papier['bdg170']->setDescription1('Bilderdruck glänzend 170 gr');
|
|
|
|
$papier['bdm250'] = new Paper();
|
|
$papier['bdm250']->setArtNr('bdm250');
|
|
$papier['bdm250']->setDescription1('Bilderdruck matt 250 gr');
|
|
|
|
$papier['bdg250'] = new Paper();
|
|
$papier['bdg250']->setArtNr('bdg250');
|
|
$papier['bdg250']->setDescription1('Bilderdruck glänzend 250 gr');
|
|
|
|
$papier['bdm300'] = new Paper();
|
|
$papier['bdm300']->setArtNr('bdm300');
|
|
$papier['bdm300']->setDescription1('Bilderdruck matt 300 gr');
|
|
|
|
$papier['bdg300'] = new Paper();
|
|
$papier['bdg300']->setArtNr('bdg300');
|
|
$papier['bdg300']->setDescription1('Bilderdruck glänzend 300 gr');
|
|
|
|
return $papier[$criteria['artNr']];
|
|
|
|
}
|
|
|
|
/**
|
|
* Returns the class name of the object managed by the repository.
|
|
*
|
|
* @return string
|
|
*/
|
|
public function getClassName()
|
|
{
|
|
// TODO: Implement getClassName() method.
|
|
}
|
|
}
|