Open Journal Systems  3.3.0
COUNTER\ReportBuilder Class Reference
Inheritance diagram for COUNTER\ReportBuilder:
COUNTER\Consortium COUNTER\Contact COUNTER\Customer COUNTER\DateRange COUNTER\Identifier COUNTER\ItemAttribute COUNTER\ItemContributor COUNTER\ItemContributorId COUNTER\ItemDate COUNTER\Metric COUNTER\ParentItem COUNTER\PerformanceCounter COUNTER\Report COUNTER\ReportItems COUNTER\Reports COUNTER\Vendor

Public Member Functions

 __toString ()
 
 asDOMDocument ()
 

Static Public Member Functions

static build ($array)
 

Data Fields

const COUNTER_NAMESPACE = 'http://www.niso.org/schemas/counter'
 

Protected Member Functions

 buildMultiple ($classname, $array)
 
 getAttributeTypes ()
 
 getCategories ()
 
 getContributorIdentifierTypes ()
 
 getDateTypes ()
 
 getIdentifierTypes ()
 
 getItemDataTypes ()
 
 getMetricTypes ()
 
 validateOneOf ($object, $className)
 
 validateOneOrMoreOf ($objects, $className)
 
 validatePositiveInteger ($int)
 
 validateString ($string)
 
 validateStrings ($array)
 
 validateZeroOrMoreOf ($objects, $className)
 
 validateZeroOrOneOf ($object, $className)
 

Static Protected Member Functions

static isAssociative ($array)
 

Detailed Description

COUNTER report builder class Other classes in this package extend from this core class to have access to several generic functions

Todo:
should "tool-like" functions be moved to static calls from an non-inherited Tools class?

Definition at line 72 of file COUNTER.php.

Member Function Documentation

◆ __toString()

COUNTER\ReportBuilder::__toString ( )

Output this object as XML Inherited by all children of this object; all children must implement asDOMDocument().

Returns
string

Definition at line 304 of file COUNTER.php.

References COUNTER\ReportBuilder\asDOMDocument().

◆ asDOMDocument()

COUNTER\ReportBuilder::asDOMDocument ( )

◆ build()

static COUNTER\ReportBuilder::build (   $array)
static

Do NOT build this object This method must be implemented in the subclass Subclasses should call this method if unable to build the object in order to report an error.

Exceptions
Exception

Reimplemented in COUNTER\PerformanceCounter, COUNTER\DateRange, COUNTER\Metric, COUNTER\ItemAttribute, COUNTER\ItemDate, COUNTER\Identifier, COUNTER\ItemContributorId, COUNTER\ItemContributor, COUNTER\ParentItem, COUNTER\ReportItems, COUNTER\Consortium, COUNTER\Customer, COUNTER\Contact, COUNTER\Vendor, COUNTER\Report, and COUNTER\Reports.

Definition at line 325 of file COUNTER.php.

◆ buildMultiple()

COUNTER\ReportBuilder::buildMultiple (   $classname,
  $array 
)
protected

Given an classname and an array, call the $classname::build method and return the built object(s) The array can be associative (for a single object), or an array of associative arrays (for multiple objects)

Parameters
string$classname
array$array
Returns
mixed object or array of objects

Definition at line 226 of file COUNTER.php.

◆ getAttributeTypes()

COUNTER\ReportBuilder::getAttributeTypes ( )
protected

Return an array of valid Date Types

Returns
array
Todo:
these values are preliminary; need an update from COUNTER

Definition at line 279 of file COUNTER.php.

Referenced by COUNTER\ItemAttribute\__construct().

◆ getCategories()

COUNTER\ReportBuilder::getCategories ( )
protected

Return an array of valid Categories

Returns
array

Definition at line 295 of file COUNTER.php.

Referenced by COUNTER\Metric\__construct().

◆ getContributorIdentifierTypes()

COUNTER\ReportBuilder::getContributorIdentifierTypes ( )
protected

Return an array of valid Contributor Identifier Types

Returns
array

Definition at line 261 of file COUNTER.php.

Referenced by COUNTER\ItemContributorId\__construct().

◆ getDateTypes()

COUNTER\ReportBuilder::getDateTypes ( )
protected

Return an array of valid Date Types

Returns
array
Todo:
these values are preliminary; need an update from COUNTER

Definition at line 270 of file COUNTER.php.

Referenced by COUNTER\ItemDate\__construct().

◆ getIdentifierTypes()

COUNTER\ReportBuilder::getIdentifierTypes ( )
protected

Return an array of valid Identifier Types

Returns
array

Definition at line 253 of file COUNTER.php.

Referenced by COUNTER\Identifier\__construct().

◆ getItemDataTypes()

COUNTER\ReportBuilder::getItemDataTypes ( )
protected

Return an array of valid Item Data Types

Returns
array
Todo:
verify addition of "Article" here for proposed release 4.2.

Definition at line 245 of file COUNTER.php.

Referenced by COUNTER\ReportItems\__construct(), and COUNTER\ParentItem\__construct().

◆ getMetricTypes()

COUNTER\ReportBuilder::getMetricTypes ( )
protected

Return an array of valid Metric Types

Returns
array

Definition at line 287 of file COUNTER.php.

Referenced by COUNTER\PerformanceCounter\__construct().

◆ isAssociative()

static COUNTER\ReportBuilder::isAssociative (   $array)
staticprotected

Check an array to see if it has associative (non-numeric) keys

Parameters
array$array
Returns
boolean

Definition at line 215 of file COUNTER.php.

◆ validateOneOf()

COUNTER\ReportBuilder::validateOneOf (   $object,
  $className 
)
protected

Validate that $object is a $className instance. If valid, return the object, otherwise, throw an exception

Parameters
object$object
string$classNameIf no namespace specified, defaults to the COUNTER namespace
Returns
object
Exceptions
Exception

Definition at line 83 of file COUNTER.php.

Referenced by COUNTER\Report\__construct(), COUNTER\ItemDate\__construct(), COUNTER\Metric\__construct(), COUNTER\DateRange\__construct(), COUNTER\Reports\addReport(), COUNTER\ReportBuilder\validateOneOrMoreOf(), and COUNTER\ReportBuilder\validateZeroOrOneOf().

◆ validateOneOrMoreOf()

COUNTER\ReportBuilder::validateOneOrMoreOf (   $objects,
  $className 
)
protected

Validate that $objects is an array of $className instances. If valid, return the array, otherwise, throw an exception

Parameters
object$objects
string$className
Returns
array
Exceptions
Exception

Definition at line 123 of file COUNTER.php.

References COUNTER\ReportBuilder\validateOneOf().

Referenced by COUNTER\Reports\__construct(), COUNTER\Report\__construct(), COUNTER\Customer\__construct(), COUNTER\ReportItems\__construct(), COUNTER\Metric\__construct(), and COUNTER\ReportBuilder\validateZeroOrMoreOf().

◆ validatePositiveInteger()

COUNTER\ReportBuilder::validatePositiveInteger (   $int)
protected

Validate that $yr is an integer. If valid, return the year, otherwise, throw an exception

Parameters
int$int
Returns
int
Exceptions
Exception

Definition at line 170 of file COUNTER.php.

Referenced by COUNTER\Metric\__construct(), and COUNTER\PerformanceCounter\__construct().

◆ validateString()

◆ validateStrings()

COUNTER\ReportBuilder::validateStrings (   $array)
protected

Validate that $array is an array of strings. If valid, return the array, otherwise, throw an exception

Parameters
array$array
Returns
array
Exceptions
Exception

Definition at line 197 of file COUNTER.php.

References COUNTER\ReportBuilder\validateString().

Referenced by COUNTER\ItemContributor\__construct().

◆ validateZeroOrMoreOf()

COUNTER\ReportBuilder::validateZeroOrMoreOf (   $objects,
  $className 
)
protected

Validate that $objects is an array of $className instances, or is empty. If valid, return the array or empty, otherwise, throw an exception

Parameters
object$objects
string$className
Returns
array
Exceptions
Exception

Definition at line 141 of file COUNTER.php.

References COUNTER\ReportBuilder\validateOneOrMoreOf().

Referenced by COUNTER\Vendor\__construct(), COUNTER\Customer\__construct(), COUNTER\ReportItems\__construct(), COUNTER\ParentItem\__construct(), and COUNTER\ItemContributor\__construct().

◆ validateZeroOrOneOf()

COUNTER\ReportBuilder::validateZeroOrOneOf (   $object,
  $className 
)
protected

Validate that $object is a $className instance, or is empty. If valid, return the object or empty, otherwise, throw an exception

Parameters
object$object
string$className
Returns
object
Exceptions
Exception

Definition at line 156 of file COUNTER.php.

References COUNTER\ReportBuilder\validateOneOf().

Referenced by COUNTER\Customer\__construct(), and COUNTER\ReportItems\__construct().

Field Documentation

◆ COUNTER_NAMESPACE

const COUNTER\ReportBuilder::COUNTER_NAMESPACE = 'http://www.niso.org/schemas/counter'

Definition at line 74 of file COUNTER.php.


The documentation for this class was generated from the following file: