Permalink
Browse files

Fix createWithName and createWithProxy

  • Loading branch information...
1 parent a852022 commit 2c8ffce37c8c0f7a9a20e2ecced49f0fea3ebead @Floby Floby committed Sep 19, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 models/DbTable/Container.php
View
3 models/DbTable/Container.php
@@ -48,6 +48,8 @@ public function createWithName($name)
list($container, $created) = $this->getOrCreate(array(
'name' => $name,
+ 'proxy_content_type_id' => null,
+ 'proxy_pk' => null
));
if(!$created) {
throw new InvalidArgumentException('There already is a container by that name');
@@ -68,6 +70,7 @@ public function createWithProxy(Centurion_Db_Table_Row_Abstract $instance)
$modelName = $instance->getTableClass();
list($model, $created) = Centurion_Db::getSingleton('core/content_type')->getOrCreate(array('name'=>$modelName));
list($container, $created) = $this->getOrCreate(array(
+ 'name' => null,
'proxy_content_type_id' => $model->id,
'proxy_pk' => $instance->pk
));

0 comments on commit 2c8ffce

Please sign in to comment.