Extension:PhpTags SMW/Reference
From Linux Web Expert
This page is currently a draft.
|
ExtArrays
class ExtArrays {
/*
* Static methods
*/
// Returns an array
static array getArray( string $arrayId );
// Returns the value of an array at position $index
static mixed getArrayValue( string $arrayId, scalar $index,
mixed $default = null );
// Unset one, more, or all (if no arguments) defined arrays
static bool unsetArray( string $arrayId = '', ... );
}
ExtSQI
class ExtSQI {
/*
* Methods
*/
// Constructor (see the SQI source for more on $config)
ExtSQI __construct( array $config = null );
// Sets query limitation to specified page
ExtSQI from( string $page, bool $flatResult = false );
// Apply some condition to query
ExtSQI condition( string|array $condition, scalar $conditionValue = null );
// Sets query limitation to category(ies)
ExtSQI category( string $category );
// Adds property to be fetched and printed out, use * to print out all
// properties
ExtSQI printout( string|array $printout );
// Set query results limit
ExtSQI limit( int $limit );
// Set query results offset
ExtSQI offset( int $offset );
// Counts query results
int count();
// Set query sorting subject property
ExtSQI sort( $sortProperty, $direction = 'ASC' );
// Main method to get query results. Converts raw semantic result to human
// readable array
array toArray( bool $stringifyPropValues = false );
}
WSemanticData
class WSemanticData {
/*
* Static methods
*/
// Add a value for a property to the current page. $value can be
// scalar|null, or an array of scalar|null (which is converted into a
// record value string)
static addValue( string $property, scalar|null|array $value );
// Add property values to the current page. $valueAssignments should be an
// array of 'property' => array( value, ... ) entries. Single values can
// also be given directly instead of in inner arrays, except when using
// the array format for a record value
static addValues( array $valueAssignments );
// Add a subobject to the current page. $valueAssignments has the same
// format as in addValues(). $id can optionally name the subobject.
// $linkbackProperty can optionally name a property to add with the page
// name
static addSubobject( array $valueAssignments, string $id = '',
string $linkbackProperty = '' );
}
WSemanticProperty
class WSemanticProperty {
/*
* Static methods
*/
// Normalize $property string, making it look good for display
static string normalize( string $property );
// Get property ID (special property ID or page name with underscores) for
// $property, or empty string if none
static string findId( string $property );
// Get property name (special property label or normalized page name) for
// $property, or empty string if none
static string findName( string $property, bool $getIdIfNameless = false );
// Deprecated - use findId() instead.
static string getIdForName( string $name );
// Deprecated - use findName() instead.
static string getNameForId( string $id, bool $getIdIfNameless = true );
}
WSemanticStats
class WSemanticStats {
/*
* Constants
*/
// Number of property instances (value assignments) in the database
const int PROPERTY_VALUES;
// Number of property values that do not match the type or allowed values
// for the property (requires SMW 2.2+)
const int IMPROPER_VALUES;
// Number of properties that have been assigned at least one value
const int PROPERTIES_USED;
// Number of properties with their own page
const int PROPERTIES_WITH_PAGES;
// Number of properties that have been declared (i.e. assigned a type)
const int PROPERTIES_ASSIGNED_TYPES;
// Number of declared subobjects
const int SUBOBJECTS;
// Number of inline queries
const int QUERIES;
// Number of declared concepts
const int CONCEPTS;
// Number of available datatypes for properties
const int DATATYPES;
}