The Phing tasks that you used at buildtime are now refactored to Commands using the Symfony2 Command component. They work the same, but their name has changed.
Replace... With...
build-model model:build
build-sql sql:build
insert-sql sql:insert
convert-conf config:convert-xml
diff [not yet refactored]
status migration:status
migrate [not yet refactored]
up migration:up
down migration:down
reverse [not yet refactored]
Some static methods from the Propel
class have been renamed. Therefore, you must replace the following occurrences in your code:
Replace... With...
Propel::CONNECTION_WRITE ServiceContainerInterface::CONNECTION_WRITE
Propel::CONNECTION_READ ServiceContainerInterface::CONNECTION_READ
Propel::getDB($name) Propel::getAdapter($name)
Propel::getConnection($name, Propel::CONNECTION_READ) Propel::getReadConnection($name)
Propel::getConnection($name, Propel::CONNECTION_WRITE) Propel::getWriteConnection($name)
Propel::getDefaultDB() Propel::getDefaultDatasource()
The generated model is automatically updated once you rebuild your model.
Tip: Internally,
Propel::getAdapter()
proxies toPropel::getServiceContainer()->getAdapter()
. ThePropel
class was refactored to keep only one static class and to be more extensible. It remains the easy entry point to all the necessary services provided by Propel.
Propel::setConnection()
is removed. As for Propel::init($configFilePath)
, where $configFilePath
is the path to the PHP configuration generated by the config:convert-xml
command, you can now replace it with include $configFilePath
.
The classes used by Propel internally to build the object model were renamed. This affects your project if you extended one of these classes.
Replace... With...
OMBuilder.php AbstractBuilder.php
ObjectBuilder.php __removed__
PeerBuilder.php __removed__
PHP5ExtensionObjectBuilder.php ExtensionObjectBuilder.php
PHP5ExtensionPeerBuilder.php __removed__
PHP5InterfaceBuilder.php InterfaceBuilder.php
PHP5MultiExtendObjectBuilder.php MultiExtendObjectBuilder.php
PHP5ObjectBuilder.php ObjectBuilder.php
PHP5PeerBuilder.php __removed__
PHP5TableMapBuilder.php TableMapBuilder.php
Base classes are generated in a Base
directory, and base classes are no more prefixed by Base
.
Parameters basePrefix
and namespaceOm
have been removed
Before:
public function setAppData(AppData $parent)
After:
public function setParentSchema(Schema $parent)
Before:
public function getAppData()
After:
public function getParentSchema()
The AppData::joinAppDatas
method has been renamed to Schema::joinSchemas
.
Before:
public function joinAppDatas($ads)
After:
public function joinSchemas($schemas)
Both SchemaReader::parseString
and SchemaReader::parseFile
methods return
a Propel\Generator\Model\Schema
object instead of a Propel\Generator\Model\AppData
object.
Before:
public function __construct(AppData $appData)
After:
public function __construct(Schema $schema)
Propel\Generator\Model\Column::printSize
method has been renamed to Propel\Generator\Model\Column::getSizeDefinition
.
Propel\Generator\Model\Domain::getSizeDefinition
.
Propel\Generator\Model\ScopedElement
class has been renamed to Propel\Generator\Model\ScopedMappingModel
.
Propel\Generator\Model\XmlElement::loadFromXml
method has been renamed to Propel\Generator\Model\MappingModel::loadMapping
.
Propel\Runtime\ActiveQuery\Criteria::addOr
operates only on existing conditions, where prior it would OR
to a condition to
on the same column (if it existed).
E.g.
$criteria->add('column1', 'value');
$criteria->add('column2', 'value');
$criteria->addOr('column1', 'value'); // this used to be OR`ed to the first add (matched by name)
All base object methods have been merged in generated Base Object classes.
This could break, behaviors that call parent
methods
All methods from Propel\Runtime\Om\Persistent
Interface have been removed
All Base Object classes now implements Propel\Runtime\Om\ActiveRecordInterface
this could be use to identify a Propel Object
To get the old behavior use Propel\Runtime\Util\PropelModelPager::getNbResults()
.