public function setFields(&$elements, $group = null, $replace = true)
	{
		// Make sure there is a valid Form XML document.
		if (!($this->xml instanceof SimpleXMLElement))
		{
			// TODO: throw exception.
			return false;
		}

		// Make sure the elements to set are valid.
		foreach ($elements as $element)
		{
			if (!($element instanceof SimpleXMLElement))
			{
				// TODO: throw exception.
				return false;
			}
		}

		// Set the fields.
		$return = true;
		foreach ($elements as $element)
		{
			if (!$this->setField($element, $group, $replace))
			{
				$return = false;
			}
		}

		// Synchronize any paths found in the load.
		$this->syncPaths();

		return $return;
	}
public function setFields(&$elements, $group = null, $replace = true)
	{
		// Make sure there is a valid Form XML document.
		if (!($this->xml instanceof SimpleXMLElement))
		{
			// TODO: throw exception.
			return false;
		}

		// Make sure the elements to set are valid.
		foreach ($elements as $element)
		{
			if (!($element instanceof SimpleXMLElement))
			{
				// TODO: throw exception.
				return false;
			}
		}

		// Set the fields.
		$return = true;
		foreach ($elements as $element)
		{
			if (!$this->setField($element, $group, $replace))
			{
				$return = false;
			}
		}

		// Synchronize any paths found in the load.
		$this->syncPaths();

		return $return;
	}
public function setFields ( & $ elements , $ group = null , $ replace = true ) { // Make sure there is a valid Form XML document. if ( ! ( $ this -> xml instanceof SimpleXMLElement ) ) { // TODO: throw exception. return false ; } // Make sure the elements to set are valid. foreach ( $ elements as $ element ) { if ( ! ( $ element instanceof SimpleXMLElement ) ) { // TODO: throw exception. return false ; } } // Set the fields. $ return = true ; foreach ( $ elements as $ element ) { if ( ! $ this -> setField ( $ element , $ group , $ replace ) ) { $ return = false ; } } // Synchronize any paths found in the load. $ this -> syncPaths ( ) ; return $ return ; }
Method to set some field XML elements to the form definition.  If the replace flag is set then
the fields will be set whether they already exists or not.  If it isn't set, then the fields
will not be replaced if they already exist.

@param   object   &$elements  The array of XML element object representations of the form fields.
@param   string   $group      The optional dot-separated form group path on which to set the fields.
@param   boolean  $replace    True to replace existing fields if they already exist.
@return  boolean  True on success.
Method to set some field XML elements to the form definition . If the replace flag is set then the fields will be set whether they already exists or not . If it isn t set then the fields will not be replaced if they already exist .