Class PrototypeUtility
Quick prototypes for RESTClient
allow get/create/update/patch
to be mocked and dynamically defined
Input should always guarantee atleast two
parameters. term and object
-
Catapult\BaseUtilities
-
Catapult\PrototypeUtility
Methods summary
public
|
|
public static
|
#
get_this( args: $args )
Get this from a static
context. Will be used
for the other methods.
last parameter should be the object
Get this from a static
context. Will be used
for the other methods.
last parameter should be the object
Parameters
|
public
|
#
get_term( args: $args )
get the term
associated with
this subfunction
should be a valid term
in Catapult models
get the term
associated with
this subfunction
should be a valid term
in Catapult models
Parameters
|
public
|
#
get_id( args: $args )
IDs for subfunctions
can be found in the first
parameter
IDs for subfunctions
can be found in the first
parameter
Parameters
|
public
|
#
get_is_plural( args: $args )
IDs for subfunctions
can be found in the first
parameter
IDs for subfunctions
can be found in the first
parameter
Parameters
|
public static
|
#
get( )
Mock get functions
read whether we need to
use an id or not
then run accordingly
last parameter will always
be 'this' object
Mock get functions
read whether we need to
use an id or not
then run accordingly
last parameter will always
be 'this' object
|
public static
|
#
add( )
prototypal add. This needs
term to be set as a function
in its caller it will be used
to initialize the resulting
object
prototypal add. This needs
term to be set as a function
in its caller it will be used
to initialize the resulting
object
Conference->addMember
should return
ConferenceMember
Params:
mix of function arguments as well as object prototypes, terms
|
public static
|
#
update( )
Prototypal update.
must have sub id to reference
allows mocking
of functions like:
Prototypal update.
must have sub id to reference
allows mocking
of functions like:
Conference->updateMember(array(memberId=1))
termId should always be
term + Id
make sure it is singular.
|