Skip to content

Commit

Permalink
Added missing constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
canni committed Nov 30, 2010
1 parent 6484d86 commit eec6782
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions EMongoDocument.php
Expand Up @@ -41,6 +41,27 @@ public function __call($name, $parameters)
return parent::__call($name,$parameters);
}

/**
* Constructor {@see setScenario()}
*
* @param string $scenario
*/
public function __construct($scenario='insert')
{
if($scenario==null) // internally used by populateRecord() and model()
return;

$this->setScenario($scenario);
$this->setIsNewRecord(true);

$this->init();

$this->attachBehaviors($this->behaviors());
$this->afterConstruct();

$this->initEmbeddedDocuments();
}

/**
* Get EMongoDB component instance
* By default it is mongodb application component
Expand Down

0 comments on commit eec6782

Please sign in to comment.