Back to ExtensionAdapter class

Method _startElement

protected void
_startElement
(mixed $parser, mixed $name, mixed $attrs = array())
Start element parser callback.
Parameters
  • object $parser The parser object.
  • string $name The name of the element.
  • array $attrs The attributes of the element.
Returns
  • void
Since
  • 1.7.0

Method _startElement - Source code

/**
 * Start element parser callback.
 *
 * @param   object  $parser  The parser object.
 * @param   string  $name    The name of the element.
 * @param   array   $attrs   The attributes of the element.
 *
 * @return  void
 *
 * @since   1.7.0
 */
protected function _startElement($parser, $name, $attrs = array())
{
    $this->stack[] = $name;
    $tag = $this->_getStackLocation();
    // Reset the data
    if (isset($this->{$tag})) {
        $this->{$tag}->_data = '';
    }
    switch ($name) {
        case 'UPDATE':
            $this->currentUpdate = Table::getInstance('update');
            $this->currentUpdate->update_site_id = $this->updateSiteId;
            $this->currentUpdate->detailsurl = $this->_url;
            $this->currentUpdate->folder = '';
            $this->currentUpdate->client_id = 1;
            $this->currentUpdate->infourl = '';
            break;
        // Don't do anything
        case 'UPDATES':
            break;
        default:
            if (\in_array($name, $this->updatecols)) {
                $name = strtolower($name);
                $this->currentUpdate->{$name} = '';
            }
            if ($name === 'TARGETPLATFORM') {
                $this->currentUpdate->targetplatform = $attrs;
            }
            if ($name === 'PHP_MINIMUM') {
                $this->currentUpdate->php_minimum = '';
            }
            if ($name === 'SUPPORTED_DATABASES') {
                $this->currentUpdate->supported_databases = $attrs;
            }
            break;
    }
}