/** * Parse css content * * @return void */ protected function parse() { $this->media = array(); $this->extras = array(); $this->sheet->resetContents(); $this->acceptBom(); while (!empty($this->buffer)) { $this->acceptEntry(); } $extraContent = ''; foreach ($this->extras as $media => $extra) { if (empty($media)) { $extraContent .= $extra; } else { $extraContent .= "@media {$media}\n{\n{$extra}\n}\n"; } $extraContent .= "\n"; } $this->sheet->setExtraContent($extraContent); }
/** * Remove a structure * * @param int|string|array|Structure $structureOrPrimaryKeys * @return int */ public function delete($structureOrPrimaryKeys) { if ($structureOrPrimaryKeys instanceof Structure) { $structure = $structureOrPrimaryKeys->resetContents(); } else { if (null === $structureOrPrimaryKeys || is_scalar($structureOrPrimaryKeys)) { $structure = $this->createStructure(array('rootId' => $structureOrPrimaryKeys)); } else { $structureOrPrimaryKeys = (array) $structureOrPrimaryKeys; $structure = $this->createStructure(array('rootId' => isset($structureOrPrimaryKeys['rootId']) ? $structureOrPrimaryKeys['rootId'] : reset($structureOrPrimaryKeys))); } } return $this->save($structure); }