Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test for paramconverter, fix issue with paramconverter findOneByXXX
- Loading branch information
Showing
9 changed files
with
2,029 additions
and
5 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Propel\PropelBundle\Tests\Fixtures\Model; | ||
|
||
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBook; | ||
|
||
|
||
/** | ||
* Skeleton subclass for representing a row from the 'book' table. | ||
* | ||
* | ||
* | ||
* You should add additional methods to this class to meet the | ||
* application requirements. This class will only be generated as | ||
* long as it does not already exist in the output directory. | ||
* | ||
*/ | ||
class Book extends BaseBook { | ||
|
||
} // Book |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Propel\PropelBundle\Tests\Fixtures\Model; | ||
|
||
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBookPeer; | ||
|
||
|
||
/** | ||
* Skeleton subclass for performing query and update operations on the 'book' table. | ||
* | ||
* | ||
* | ||
* You should add additional methods to this class to meet the | ||
* application requirements. This class will only be generated as | ||
* long as it does not already exist in the output directory. | ||
* | ||
*/ | ||
class BookPeer extends BaseBookPeer { | ||
|
||
} // BookPeer |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
|
||
namespace Propel\PropelBundle\Tests\Fixtures\Model; | ||
|
||
use Propel\PropelBundle\Tests\Fixtures\Model\om\BaseBookQuery; | ||
|
||
|
||
/** | ||
* Skeleton subclass for performing query and update operations on the 'book' table. | ||
* | ||
* | ||
* | ||
* You should add additional methods to this class to meet the | ||
* application requirements. This class will only be generated as | ||
* long as it does not already exist in the output directory. | ||
* | ||
*/ | ||
class BookQuery extends BaseBookQuery { | ||
|
||
private $bySlug = false; | ||
/** | ||
* fake for test | ||
*/ | ||
public function findPk($key, $con = null) | ||
{ | ||
if (1 === $key) { | ||
$book = new Book(); | ||
$book->setId(1); | ||
return $book; | ||
} | ||
return null; | ||
} | ||
|
||
/** | ||
* fake for test | ||
*/ | ||
public function filterBySlug($slug = null, $comparison = null) | ||
{ | ||
if ('my-book' == $slug) { | ||
$this->bySlug = true; | ||
} | ||
return $this; | ||
} | ||
|
||
/** | ||
* fake for test | ||
*/ | ||
public function findOne($con = null) | ||
{ | ||
if ($this->bySlug) { | ||
$book = new Book(); | ||
$book->setId(1); | ||
$book->setName('My Book'); | ||
$book->setSlug('my-book'); | ||
return $book; | ||
} | ||
return null; | ||
} | ||
} // BookQuery |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace Propel\PropelBundle\Tests\Fixtures\Model\map; | ||
|
||
use \RelationMap; | ||
use \TableMap; | ||
|
||
|
||
/** | ||
* This class defines the structure of the 'book' table. | ||
* | ||
* | ||
* | ||
* This map class is used by Propel to do runtime db structure discovery. | ||
* For example, the createSelectSql() method checks the type of a given column used in an | ||
* ORDER BY clause to know whether it needs to apply SQL to make the ORDER BY case-insensitive | ||
* (i.e. if it's a text column type). | ||
* | ||
*/ | ||
class BookTableMap extends TableMap | ||
{ | ||
|
||
/** | ||
* The (dot-path) name of this class | ||
*/ | ||
const CLASS_NAME = 'vendor/bundles/Propel/PropelBundle/Tests/Fixtures/Model.map.BookTableMap'; | ||
|
||
/** | ||
* Initialize the table attributes, columns and validators | ||
* Relations are not initialized by this method since they are lazy loaded | ||
* | ||
* @return void | ||
* @throws PropelException | ||
*/ | ||
public function initialize() | ||
{ | ||
// attributes | ||
$this->setName('book'); | ||
$this->setPhpName('Book'); | ||
$this->setClassname('Propel\\PropelBundle\\Tests\\Fixtures\\Model\\Book'); | ||
$this->setPackage('vendor/bundles/Propel/PropelBundle/Tests/Fixtures/Model'); | ||
$this->setUseIdGenerator(true); | ||
// columns | ||
$this->addPrimaryKey('ID', 'Id', 'INTEGER', true, null, null); | ||
$this->addColumn('NAME', 'Name', 'VARCHAR', false, 255, null); | ||
$this->addColumn('SLUG', 'Slug', 'VARCHAR', false, 255, null); | ||
// validators | ||
} // initialize() | ||
|
||
/** | ||
* Build the RelationMap objects for this table relationships | ||
*/ | ||
public function buildRelations() | ||
{ | ||
} // buildRelations() | ||
|
||
} // BookTableMap |
Oops, something went wrong.