We offered you 5 ways to Select
into the XMLDB:
You can find the different return value possible here.
Select table
Syntax: public function selectTable($name, $format = 'node')
Example:
By default, the function returns a node (a DOMDocument NodeList)
this will select the table (with the table configuration)
Select everything from a table
Syntax: public function selectAllFromTable($name, $format = 'node')
Example:
This will return the number of items inside table1. By default, it'll return a node
.
Select with primary key
Syntax: public function selectFromPK($table, $pk, $format = "array")
Example:
By default, the function returns an array
Select with other attributes
Syntax: public function selectFromAttribute($table, $attributes, $format = 'array')
Example:
By default, the function returns an array
You can notice that this example returns the same thing as with PK if your pk stays with "id" because the primary key is an attribute.
Select with children
Syntax: public function selectFromChildren($table, $childs, $format = 'array')
Example:
By default, the function returns an array. Here, it will select all items having a child like this : <visibility>true</visibility>