lithium\data\source\mongo_db\Exporter::get PHP Method

get() public static method

public static get ( $type, $export, array $options = [] )
$options array
    public static function get($type, $export, array $options = array())
    {
        $defaults = array('whitelist' => array());
        $options += $defaults;
        if (!method_exists(get_called_class(), $method = "_{$type}") || !$export) {
            return;
        }
        return static::$method($export, array('finalize' => true) + $options);
    }

Usage Example

Example #1
0
	/**
	 * Tests that a nested key on a previously saved document gets updated properly.
	 */
	public function testExistingNestedKeyOverwrite() {
		$doc = new Document(array('model' => $this->_model));
		$doc->{'this.that'} = 'value1';
		$this->assertEqual(array('this' => array('that' => 'value1')), $doc->data());

		$result = Exporter::get('create', $doc->export());
		$this->assertEqual(array('create' => array('this' => array('that' => 'value1'))), $result);

		$doc->sync();
		$doc->{'this.that'} = 'value2';
		$this->assertEqual(array('this' => array('that' => 'value2')), $doc->data());

		$result = Exporter::get('update', $doc->export());
		$this->assertEqual(array('update' => array('this.that' => 'value2')), $result);
	}
All Usage Examples Of lithium\data\source\mongo_db\Exporter::get