abstract class AbstractFeed in Zircon Profile 8.0
Same name in this branch
- 8.0 vendor/zendframework/zend-feed/src/Reader/AbstractFeed.php \Zend\Feed\Reader\AbstractFeed
- 8.0 vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php \Zend\Feed\Writer\AbstractFeed
- 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/AbstractFeed.php \Zend\Feed\Reader\Extension\AbstractFeed
- 8.0 vendor/zendframework/zend-feed/src/Reader/Feed/AbstractFeed.php \Zend\Feed\Reader\Feed\AbstractFeed
Same name and namespace in other branches
- 8 vendor/zendframework/zend-feed/src/Reader/Extension/AbstractFeed.php \Zend\Feed\Reader\Extension\AbstractFeed
Hierarchy
- class \Zend\Feed\Reader\Extension\AbstractFeed
Expanded class hierarchy of AbstractFeed
File
- vendor/
zendframework/ zend-feed/ src/ Reader/ Extension/ AbstractFeed.php, line 16
Namespace
Zend\Feed\Reader\ExtensionView source
abstract class AbstractFeed {
/**
* Parsed feed data
*
* @var array
*/
protected $data = [];
/**
* Parsed feed data in the shape of a DOMDocument
*
* @var DOMDocument
*/
protected $domDocument = null;
/**
* The base XPath query used to retrieve feed data
*
* @var DOMXPath
*/
protected $xpath = null;
/**
* The XPath prefix
*
* @var string
*/
protected $xpathPrefix = '';
/**
* Set the DOM document
*
* @param DOMDocument $dom
* @return AbstractFeed
*/
public function setDomDocument(DOMDocument $dom) {
$this->domDocument = $dom;
return $this;
}
/**
* Get the DOM
*
* @return DOMDocument
*/
public function getDomDocument() {
return $this->domDocument;
}
/**
* Get the Feed's encoding
*
* @return string
*/
public function getEncoding() {
$assumed = $this
->getDomDocument()->encoding;
return $assumed;
}
/**
* Set the feed type
*
* @param string $type
* @return AbstractFeed
*/
public function setType($type) {
$this->data['type'] = $type;
return $this;
}
/**
* Get the feed type
*
* If null, it will attempt to autodetect the type.
*
* @return string
*/
public function getType() {
$type = $this->data['type'];
if (null === $type) {
$type = Reader\Reader::detectType($this
->getDomDocument());
$this
->setType($type);
}
return $type;
}
/**
* Return the feed as an array
*
* @return array
*/
public function toArray() {
return $this->data;
}
/**
* Set the XPath query
*
* @param DOMXPath $xpath
* @return AbstractEntry
*/
public function setXpath(DOMXPath $xpath = null) {
if (null === $xpath) {
$this->xpath = null;
return $this;
}
$this->xpath = $xpath;
$this
->registerNamespaces();
return $this;
}
/**
* Get the DOMXPath object
*
* @return string
*/
public function getXpath() {
if (null === $this->xpath) {
$this
->setXpath(new DOMXPath($this
->getDomDocument()));
}
return $this->xpath;
}
/**
* Get the XPath prefix
*
* @return string
*/
public function getXpathPrefix() {
return $this->xpathPrefix;
}
/**
* Set the XPath prefix
*
* @param string $prefix
* @return void
*/
public function setXpathPrefix($prefix) {
$this->xpathPrefix = $prefix;
}
/**
* Register the default namespaces for the current feed format
*/
protected abstract function registerNamespaces();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
AbstractFeed:: |
protected | property | Parsed feed data | |
AbstractFeed:: |
protected | property | Parsed feed data in the shape of a DOMDocument | |
AbstractFeed:: |
protected | property | The base XPath query used to retrieve feed data | |
AbstractFeed:: |
protected | property | The XPath prefix | |
AbstractFeed:: |
public | function | Get the DOM | |
AbstractFeed:: |
public | function | Get the Feed's encoding | |
AbstractFeed:: |
public | function | Get the feed type | |
AbstractFeed:: |
public | function | Get the DOMXPath object | |
AbstractFeed:: |
public | function | Get the XPath prefix | |
AbstractFeed:: |
abstract protected | function | Register the default namespaces for the current feed format | |
AbstractFeed:: |
public | function | Set the DOM document | |
AbstractFeed:: |
public | function | Set the feed type | |
AbstractFeed:: |
public | function | Set the XPath query | |
AbstractFeed:: |
public | function | Set the XPath prefix | |
AbstractFeed:: |
public | function | Return the feed as an array |