/** * Default JSON query assembly */ function assemble() { parent::assemble(); $this->addFilter(new Filter\Decoder()); if (!$this->hasObservers(self::SAVE)) { $this->attach(self::SAVE, function ($s, $e) { $this->save($e['result']); }); } }
/** * Default XML query assembly * @return boolean */ protected function assemble() { $this['xpath'] = ''; $this->attach(self::SAVE, function ($s, $e) { $doc = $this->getDocument(); if ($doc instanceof \DOMDocument) { $doc->save($this->getResource()->getPath()); } elseif ($doc instanceof \SimpleXMLElement) { $doc->asXml($this->getResource()->getPath()); } }); return parent::assemble(); }
/** * Default INI query filters */ function assemble() { if (!parent::assemble()) { return; } $this->addFilter(new Filter\Parse(true)); $this->addFilter(function ($array) { return $this->array = $array; }); if (!$this->hasObservers(self::SAVE)) { $this->attach(self::SAVE, function ($s, $e) { $this->save($e['result']); }); } }
/** * Default YML query assembly */ function assemble() { $this['ypath'] = ''; parent::assemble(); $this->addFilter(new Filter\Parse(true)); $this->addFilter(function ($array) { return $this->array =& $array; }); if (isset($this['ypath']) && !empty($this['ypath'])) { $this->addFilter(new Filter\Ypath($this)); } if (!$this->hasObservers(self::SAVE)) { $this->attach(self::SAVE, function ($s, $e) { $this->save($e['result']); }); } }