Phactory\Mongo\Phactory::createWithAssociations PHP Method

createWithAssociations() public method

The document is saved to the database, and returned as an array.
public createWithAssociations ( $blueprint_name, $associations = [], $overrides = [] )
$blueprint_name name of the blueprint to use
$associations [collection name] => [array]
$overrides key => value pairs of field => value
    public function createWithAssociations($blueprint_name, $associations = array(), $overrides = array())
    {
        if (!($blueprint = $this->_blueprints[$blueprint_name])) {
            throw new \Exception("No blueprint defined for '{$blueprint_name}'");
        }
        return $blueprint->create($overrides, $associations);
    }