PHP Class Box\Spout\Reader\Common\XMLProcessor

Show file Open project: box/spout

Protected Properties

Property Type Description
$xmlReader The XMLReader object that will help read sheet's XML data

Public Methods

Method Description
__construct ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader )
readUntilStopped ( ) : void Resumes the reading of the XML file where it was left off.
registerCallback ( string $nodeName, integer $nodeType, callable $callback ) : XMLProcessor

Private Methods

Method Description
getCallbackKey ( string $nodeName, integer $nodeType ) : string
getInvokableCallbackData ( callable $callback ) : array Because the callback can be a "protected" function, we don't want to use call_user_func() directly but instead invoke the callback using Reflection. This allows the invocation of "protected" functions.
getRegisteredCallbackData ( string $nodeNamePossiblyWithPrefix, string $nodeNameWithoutPrefix, integer $nodeType ) : array | null
invokeCallback ( array $callbackData, array $args ) : integer

Method Details

__construct() public method

public __construct ( Box\Spout\Reader\Wrapper\XMLReader $xmlReader )
$xmlReader Box\Spout\Reader\Wrapper\XMLReader XMLReader object

readUntilStopped() public method

Stops whenever a callback indicates that reading should stop or at the end of the file.
public readUntilStopped ( ) : void
return void

registerCallback() public method

public registerCallback ( string $nodeName, integer $nodeType, callable $callback ) : XMLProcessor
$nodeName string A callback may be triggered when a node with this name is read
$nodeType integer Type of the node [NODE_TYPE_START || NODE_TYPE_END]
$callback callable Callback to execute when the read node has the given name and type
return XMLProcessor

Property Details

$xmlReader protected property

The XMLReader object that will help read sheet's XML data
protected $xmlReader