Sets up the Inheritance object based on the attributes that were passed to loadFromXML().
@see        parent::loadFromXML()
162195
protected function setupObject()
	{
		$this->key = $this->getAttribute("key");
		$this->className = $this->getAttribute("class");
		$this->pkg = $this->getAttribute("package");
		$this->ancestor = $this->getAttribute("extends");
	}
476918
private function loadXml($file)
    {
        $internal = libxml_use_internal_errors(true);

        $doc = new DOMDocument();
        $doc->preserveWhiteSpace = false;
        $doc->validateOnParse = true;

        if (!@$doc->load($file)) {
            $errors = libxml_get_errors();

            libxml_use_internal_errors($internal);

            throw XmlException::createUsingErrors($errors);
        }

        libxml_use_internal_errors($internal);

        return new DOMXPath($doc);
    }
338106
public function FromXML($xml)
	{
		$sxo = new SimpleXMLElement($xml);
		
		if($sxo->encoding == "base64")
		{
			$this->Data = base64_decode($sxo->data);
		}
		else
		{
			$this->Data = $sxo->data;
		}
		
		$this->Name = $attachment->name;
		$this->Type = $attachment->type;
		$this->Size = $attachment->size;
		$this->Extension = $attachment->extension;
	}
1151396
protected function loadXml( $xml )
	{
		$xsv	= new XML_DOM_SyntaxValidator;
		if( !$xsv->validate( $xml ) )
			throw new Exception( "XML Document is not valid:".$xsv->getErrors() );
		$this->document	= $xsv->getDocument();
		$this->clearOptions();
		foreach( $this->attributes as $attribute )
			if( isset( $this->document->$attribute ) )
				$this->setOption( $attribute, $this->document->$attribute );
	}
74353
function initializeObjectAttribute( $contentObjectAttribute, $currentVersion, $originalContentObjectAttribute )
    {

        if ( $currentVersion != false )
        {
            $matrix = $originalContentObjectAttribute->content();
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            // make sure that $matrix contains right columns
            $matrix->adjustColumnsToDefinition( $contentClassAttribute->attribute( 'content' ) );

            $contentObjectAttribute->setAttribute( 'data_text', $matrix->xmlString() );
            $contentObjectAttribute->setContent( $matrix );
        }
        else
        {
            $contentClassAttribute = $contentObjectAttribute->contentClassAttribute();
            $numRows = $contentClassAttribute->attribute( 'data_int1' );
            $matrix = new eZMatrix( '', $numRows, $contentClassAttribute->attribute( 'content' ) );
            // 'default name' is never used => just a stub
            // $matrix->setName( $contentClassAttribute->attribute( 'data_text1' ) );
            $contentObjectAttribute->setAttribute( 'data_text', $matrix->xmlString() );
            $contentObjectAttribute->setContent( $matrix );
        }

    }
765221
protected function buildXml()
  {
    parent::buildXml();

   $checkedFiles = array();
   if ( !empty($_POST['files']) && is_array($_POST['files']) ){
     foreach ( $_POST['files'] as $file){
       $checkedFiles[$file['name']] = $file;
     }
   }

   for ($i = 0; $i < $this->zip->numFiles; $i++)
    {
      $fileName = $this->zip->getNameIndex($i);
      if ( !empty($checkedFiles[$fileName]) && $checkedFiles[$fileName]['options'] == 'ok' )
      {
        // file was sucessfully unzipped before
        $this->appendUnzippedNode($this->unzippedNodes,$fileName);
        continue;
      }

      $filePathInfo = pathinfo($fileName);
      $fileType = 'File';
      $fileStat = $this->zip->statName($i);
      if ( empty($filePathInfo['extension']) && empty($fileStat['size']) ){
        $fileType = 'Folder';
        // check if we can create subfolder
        if ( !$this->_currentFolder->checkAcl( CKFINDER_CONNECTOR_ACL_FOLDER_CREATE ) ){
          $this->errorCode = CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED;
          $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
          continue;
        }
      }
      $extractPath = $this->_currentFolder->getServerPath();
      $extractClientPath = $this->_currentFolder->getClientPath();

      $sFileName = $this->checkOneFile( $filePathInfo, $fileName );
      // security test failed, add to skipped
      if ( false !== $sFileName )
      {
        if ( file_exists($extractPath.$sFileName) )
        {
          if ( !is_dir($extractPath.$sFileName) )
          {
            // file was checked before
            if ( !empty($checkedFiles[$fileName]['options']) )
            {
              if ( $checkedFiles[$fileName]['options'] == 'autorename')
              {
                $sFileName = CKFinder_Connector_Utils_FileSystem::autoRename($extractPath,$sFileName);
                $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
              }
              elseif ( $checkedFiles[$fileName]['options'] == 'overwrite')
              {
                if ( !$this->_currentFolder->checkAcl( CKFINDER_CONNECTOR_ACL_FILE_DELETE ) ){
                  $this->errorCode = CKFINDER_CONNECTOR_ERROR_UNAUTHORIZED;
                  $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
                  continue;
                }
                if (!CKFinder_Connector_Utils_FileSystem::unlink($extractPath.$sFileName))
                {
                  $this->errorCode = CKFINDER_CONNECTOR_ERROR_ACCESS_DENIED;
                  $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
                }
                else
                {
                  $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
                }
              }
              else
              {
                // add to skipped files
                $this->appendUnzippedNode($this->unzippedNodes,$fileName,'skip');
              }
            }
            else
            {
              $this->errorCode = CKFINDER_CONNECTOR_ERROR_ALREADY_EXIST;
              $this->appendErrorNode($this->skippedFilesNode, $this->errorCode, $fileName, $fileType);
            }
          }
        }
        // file doesn't exist yet
        else
        {
          $this->extractTo($extractPath,$extractClientPath,$filePathInfo,$sFileName,$fileName);
        }
      }
    }
    $this->zip->close();

    $this->_connectorNode->addChild($this->unzippedNodes);

    if ($this->errorCode != CKFINDER_CONNECTOR_ERROR_NONE) {
      $this->_connectorNode->addChild($this->skippedFilesNode);
      $this->_errorHandler->throwError(CKFINDER_CONNECTOR_ERROR_ZIP_FAILED);
    }
  }
1315081
public function setXml($xml)
    {
        $class = $this->nodeClass;

        if (!$xml instanceof $class) {
            $xml = new $class((string)$xml);
        }

        $this->xml = $xml;
        return $this;
    }
569619
public function setXML(&$xml)
	{
		if (is_object($xml))
		{
			if ($group = $xml['group'])
			{
				$this->_xml[(string) $group] = $xml;
			}
			else
			{
				$this->_xml['_default'] = $xml;
			}

			if ($dir = $xml['addpath'])
			{
				$this->addElementPath(PATH_ROOT . str_replace('/', DS, (string) $dir));
			}
		}
	}
247762
private function prepareSetAttributes()
    {
        $fragment = new CNabuPHPMethodBuilder($this, 'setAttributes', CNabuPHPMethodBuilder::METHOD_PROTECTED);
        $fragment->addComment("Set default attributes of $this->entity_name in XML Element.");
        $fragment->addParam(
            'element', 'SimpleXMLElement', false, null, 'SimpleXMLElement',
            'XML Element to set attributes'
        );

        if ($this->is_hashed) {
            $fragment->addFragment(
                "\$element->addAttribute('GUID', \$this->nb_data_object->grantHash(true));"
            );
        }

        if (is_array($this->element_attributes) && count($this->element_attributes) > 0) {
            $fragment->addFragment('$this->putAttributesFromList($element, array(');
            $count = count($this->element_attributes);
            foreach ($this->element_attributes as $field => $attr) {
                $fragment->addFragment("    '$field' => '$attr'" . (--$count > 0 ? ',' : ''));
            }
            $fragment->addFragment('), false);');
        }

        $this->getDocument()->addUse('\SimpleXMLElement');

        $this->addFragment($fragment);
    }
374452
public function loadDefaultElements()
    {
        // If not already set, set some defaults for organization elements
        if (is_null($this->topOrganizationDescription)) {
            $this->topOrganizationDescription = $this->translate->_('Organization');
        }

        if (is_null($this->childOrganizationDescription)) {
            $this->childOrganizationDescription = $this->translate->_('Department');
        }

        $this->getTopOrganizationElement();

        parent::loadDefaultElements();

        return $this;
    }
1231903
protected function setupClass() {
		$this->_class->setName($this->getNames()->modelName);
		$this->_class->setExtendedClass('AbstractTableGateway');
		$this->_class->setImplementedInterfaces(['EventManagerAwareInterface']);

		$docBlock = new DocBlockGenerator();
		$docBlock->setShortDescription("DataTable for {$this->getNames()->tableName}");

		$this->_class->setDocBlock($docBlock);

		// isSequence
		$property = new PropertyGenerator('isSequence');
		$property->setVisibility('private');
		$property->setDefaultValue($this->getNames()->primaryIsSequence);
		$property->setDocBlock(DocBlockGenerator::fromArray([
		    'tags' => [[
		        'name' => 'var',
		        'description' => 'boolean is primary key autonumbered']]]));
		$this->_class->addPropertyFromGenerator($property);
		
		// primaryKeyField
		$property = new PropertyGenerator('primaryKeyField');
		$property->setVisibility('private');
		$property->setDefaultValue($this->getNames()->primary);
		$property->setDocBlock(DocBlockGenerator::fromArray([
			'tags' => [[
				'name' => 'var',
				'description' => 'string name of primary key']]]));
		$this->_class->addPropertyFromGenerator($property);

		// columnDefaults
		$columnDefault = [];
		foreach ($this->getNames()->properties as $key => $value) {
			$columnDefault[$key] = $value['default'];
		}
		$property = new PropertyGenerator('columnDefaults');
		$property->setVisibility('protected');
		$property->setDefaultValue($columnDefault);
		$property->setDocBlock(DocBlockGenerator::fromArray([
			'tags' => [[
				'name' => 'var',
				'description' => 'Array default values']]]));
		$this->_class->addPropertyFromGenerator($property);

		// events
		$property = new PropertyGenerator('events');
		$property->setVisibility('protected');
		$property->setDocBlock(DocBlockGenerator::fromArray([
		    'tags' => [[
		        'name' => 'var',
		        'description' => '\Zend\EventManager\Event Event Manager']]]));
		$this->_class->addPropertyFromGenerator($property);

		$property = new PropertyGenerator('eventsEnabled');
		$property->setVisibility('protected');
		$property->setDefaultValue(true);
		$property->setDocBlock(DocBlockGenerator::fromArray([
		    'tags' => [[
		        'name' => 'var',
		        'description' => 'boolean Event Status']]]));
		$this->_class->addPropertyFromGenerator($property);

		$this->_file->setClass($this->_class);
	}
397238
public function setAttributes($figNamespace, array $attributes)
    {
        // We don't call the parent version, which does extraneous work of resolving conds and walks etc.,
        // whereas we just need to check existence of class attribute.
        // A feed tag is oblivious to other control directives.

        $this->attributes = $attributes;

        $this->feedClass = isset($this->attributes['class']) ? $this->attributes['class'] : null;
        if(null === $this->feedClass) {
            throw new RequiredAttributeException(
                $this->getTagName(),
                $this->xmlLineNumber,
                'class'
            );
        }

    }
1077135
public void initialise(XMLReader reader, AbstractGpxParserDefault parent) {
        setReader(reader);
        setParent(parent);
        setContentBuffer(parent.getContentBuffer());
        setTrkPreparedStmt(parent.getTrkPreparedStmt());
        setTrkSegmentsPreparedStmt(parent.getTrkSegmentsPreparedStmt());
        setTrkPointsPreparedStmt(parent.getTrkPointsPreparedStmt());
        setElementNames(parent.getElementNames());
        setCurrentLine(parent.getCurrentLine());
        setTrksegList(new ArrayList<Coordinate>());
        setTrkList(new ArrayList<LineString>());
    }
1303951
public function setXmlValue(array $value)
    {
        $value = array_map(
            function ($value) {
                return 'true' === $value;
            },
            $value
        );
        parent::setXmlValue($value);
    }
1162647
function initialize( $currentVersion = null, $originalContentObjectAttribute = null )
    {
        if ( $originalContentObjectAttribute === null )
            $originalContentObjectAttribute = $this;
        $classAttribute = $this->contentClassAttribute();
        $dataType = $classAttribute->dataType();
        if ( $dataType )
            $dataType->initializeObjectAttribute( $this, $currentVersion, $originalContentObjectAttribute );
    }
833558
protected function loadObject()
    {
        $this->xPDOSimpleObject = $this->modx->getObject($this->xpdo_simple_object_class, $this->getUniqueCriteria());

        if (is_object($this->xPDOSimpleObject)) {
            $this->exists = true;
            $this->current_xpdo_simple_object_data = $this->xPDOSimpleObject->toArray();
            $this->loadFromArray($this->current_xpdo_simple_object_data);
            // load related data:
            $this->loadRelatedData();
        }

        return $this;
    }
41424
protected function loadXML($xml)
	{
		$this->checkUnsupported($xml);

		// Activate small nodes allocation and relax LibXML's hardcoded limits if applicable. Limits
		// on tags can be set during configuration
		$flags = (LIBXML_VERSION >= 20700) ? LIBXML_COMPACT | LIBXML_PARSEHUGE : 0;

		$useErrors = libxml_use_internal_errors(true);
		$dom       = new DOMDocument;
		$success   = $dom->loadXML($xml, $flags);
		libxml_use_internal_errors($useErrors);

		if (!$success)
		{
			throw new InvalidArgumentException('Cannot load XML: ' . libxml_get_last_error()->message);
		}

		return $dom;
	}