This commit is contained in:
William DURAND 2013-01-11 18:57:24 +01:00
parent 9faeb85693
commit a758f32421
3 changed files with 9 additions and 11 deletions

View file

@ -11,8 +11,6 @@
namespace Propel\PropelBundle\Command;
use Propel\PropelBundle\Command\AbstractCommand;
use Propel\PropelBundle\Command\ModelBuildCommand;
use Propel\PropelBundle\Command\SqlBuildCommand;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputOption;

View file

@ -117,9 +117,9 @@ abstract class AbstractDataLoader extends AbstractDataHandler implements DataLoa
$this->deletedClasses[] = $class;
// Remove ancestors data
if(false !== ($parentClass = get_parent_class(get_parent_class($class)))) {
if (false !== ($parentClass = get_parent_class(get_parent_class($class)))) {
$reflectionClass = new \ReflectionClass($parentClass);
if(!$reflectionClass->isAbstract()) {
if (!$reflectionClass->isAbstract()) {
$this->deleteClassData($parentClass);
}
}
@ -237,21 +237,21 @@ abstract class AbstractDataLoader extends AbstractDataHandler implements DataLoa
/**
* Save a reference to the specified object (and its ancestors) before loading them.
*
* @param string $class Class name of passed object
* @param string $key Key identifying specified object
* @param BaseObject $obj A Propel object
* @param string $class Class name of passed object
* @param string $key Key identifying specified object
* @param BaseObject $obj A Propel object
*/
protected function saveParentReference($class, $key, &$obj)
{
if(method_exists($obj, 'getPrimaryKey')) {
if (method_exists($obj, 'getPrimaryKey')) {
$this->object_references[$class.'_'.$key] = $obj;
// Get parent (schema ancestor) of parent (Propel base class) in case of inheritance
if(false !== ($parentClass = get_parent_class(get_parent_class($class)))) {
if (false !== ($parentClass = get_parent_class(get_parent_class($class)))) {
$reflectionClass = new \ReflectionClass($parentClass);
if(!$reflectionClass->isAbstract()) {
if (!$reflectionClass->isAbstract()) {
$parentObj = new $parentClass;
$parentObj->fromArray($obj->toArray());
$this->saveParentReference($parentClass, $key, $parentObj);

View file

@ -11,7 +11,7 @@ abstract class BaseAbstractType extends AbstractType
'name' => '',
);
function __construct($mergeOptions = null)
public function __construct($mergeOptions = null)
{
if ($mergeOptions) {
$this->mergeOptions($mergeOptions);