Skip to content

Commit

Permalink
Fix createWithName and createWithProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
Floby committed Sep 19, 2012
1 parent a852022 commit 2c8ffce
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions models/DbTable/Container.php
Expand Up @@ -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');
Expand All @@ -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
));
Expand Down

0 comments on commit 2c8ffce

Please sign in to comment.