PHP 클래스 OEModule\PASAPI\resources\BaseResource

파일 보기 프로젝트 열기: openeyes/openeyes 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
$errors
$id string Resource ID.
$partial_record boolean Property that will allow subset of data to be updated on the resource.
$update_only boolean Property that will prevent a model being created if its set to true.
$warn_errors boolean Flag that will force all errors on the resource to be mapped to warnings.
$warnings

보호된 프로퍼티들

프로퍼티 타입 설명
$assignment OEModule\PASAPI\models\PasApiAssignment
$resource_type
$schema
$version

공개 메소드들

메소드 설명
__construct ( $version, array $options = [] ) BaseResource constructor.
addAuditData ( $key, $value ) Add to audit data property.
assignProperty ( $model, $model_key, $resource_key )
audit ( $audit_type, null $data = null, null $msg = null, array $properties = [] ) Wrapper for auditing calls on resource changes.
fromResourceId ( $version, $id ) : BaseResource Instantiate the resource from the external ID.
fromXml ( $version, $xml, array $options = [] ) : null | BaseResource Create an instance from an XML string.
fromXmlDom ( $version, DOMElement $element, array $options = [] ) : static instantiates a resource with the given XML Document.
getAssignedProperty ( $name )
getAssignment ( ) : PasApiAssignment
getAuditData ( ) : string Returns the json encoded audit data for logging.
getAuditTarget ( ) : string Simple wrapper to retrieve a type for auditing.
parseXml ( DOMElement $root, $options = [] ) Parses XML to define resource attributes.
remapValues ( $doc, XpathRemap[] $remaps = [] ) Update the given doc nodes as per the provided remaps.
setAssignment ( PasApiAssignment $assignment )
shouldValidateRequired ( ) : boolean
validate ( ) : boolean Base validator of resource from schema definition.

보호된 메소드들

메소드 설명
addError ( $msg ) Error logger.
addModelErrors ( $errors ) Convenience wrapper for handling model validation errors.
addWarning ( $msg ) Warning logger.
errorInit ( $version, $errors ) : static Convenience function to create a resource instance with error messages.
getInstanceForClass ( $class, $args = [] ) : mixed Abstraction for getting instance of class.
getSchema ( $version ) : mixed Get the schema for the resource type based on the given version.
startTransaction ( ) : CDbTransaction | null Wrapper for starting a transaction.

메소드 상세

__construct() 공개 메소드

BaseResource constructor.
public __construct ( $version, array $options = [] )
$version
$options array

addAuditData() 공개 메소드

Add to audit data property.
public addAuditData ( $key, $value )
$key
$value

addError() 보호된 메소드

Error logger.
protected addError ( $msg )
$msg

addModelErrors() 보호된 메소드

Convenience wrapper for handling model validation errors.
protected addModelErrors ( $errors )
$errors

addWarning() 보호된 메소드

Warning logger.
protected addWarning ( $msg )
$msg

assignProperty() 공개 메소드

public assignProperty ( $model, $model_key, $resource_key )
$model
$model_key
$resource_key

audit() 공개 메소드

Wrapper for auditing calls on resource changes.
public audit ( $audit_type, null $data = null, null $msg = null, array $properties = [] )
$audit_type
$data null
$msg null
$properties array

errorInit() 보호된 정적인 메소드

Convenience function to create a resource instance with error messages.
protected static errorInit ( $version, $errors ) : static
$errors array
리턴 static

fromResourceId() 공개 정적인 메소드

Instantiate the resource from the external ID.
public static fromResourceId ( $version, $id ) : BaseResource
$version
$id
리턴 BaseResource

fromXml() 공개 정적인 메소드

Create an instance from an XML string.
public static fromXml ( $version, $xml, array $options = [] ) : null | BaseResource
$version
$xml
$options array
리턴 null | BaseResource

fromXmlDom() 공개 정적인 메소드

instantiates a resource with the given XML Document.
public static fromXmlDom ( $version, DOMElement $element, array $options = [] ) : static
$version
$element DOMElement \DOMElement
$options array
리턴 static

getAssignedProperty() 공개 메소드

public getAssignedProperty ( $name )

getAssignment() 공개 메소드

public getAssignment ( ) : PasApiAssignment
리턴 OEModule\PASAPI\models\PasApiAssignment

getAuditData() 공개 메소드

Returns the json encoded audit data for logging.
public getAuditData ( ) : string
리턴 string

getAuditTarget() 공개 메소드

Simple wrapper to retrieve a type for auditing.
public getAuditTarget ( ) : string
리턴 string

getInstanceForClass() 보호된 메소드

Abstraction for getting instance of class.
protected getInstanceForClass ( $class, $args = [] ) : mixed
$class
리턴 mixed

getSchema() 보호된 정적인 메소드

Get the schema for the resource type based on the given version.
protected static getSchema ( $version ) : mixed
$version
리턴 mixed

parseXml() 공개 메소드

Parses XML to define resource attributes.
public parseXml ( DOMElement $root, $options = [] )
$root DOMElement

remapValues() 공개 정적인 메소드

Update the given doc nodes as per the provided remaps.
public static remapValues ( $doc, XpathRemap[] $remaps = [] )
$doc
$remaps OEModule\PASAPI\models\XpathRemap[]

setAssignment() 공개 메소드

public setAssignment ( PasApiAssignment $assignment )
$assignment OEModule\PASAPI\models\PasApiAssignment

shouldValidateRequired() 공개 메소드

public shouldValidateRequired ( ) : boolean
리턴 boolean

startTransaction() 보호된 메소드

Wrapper for starting a transaction.
protected startTransaction ( ) : CDbTransaction | null
리턴 CDbTransaction | null

validate() 공개 메소드

Base validator of resource from schema definition.
public validate ( ) : boolean
리턴 boolean

프로퍼티 상세

$assignment 보호되어 있는 프로퍼티

protected PasApiAssignment,OEModule\PASAPI\models $assignment
리턴 OEModule\PASAPI\models\PasApiAssignment

$errors 공개적으로 프로퍼티

public $errors

$id 공개적으로 프로퍼티

Resource ID.
public string $id
리턴 string

$partial_record 공개적으로 프로퍼티

Property that will allow subset of data to be updated on the resource.
public bool $partial_record
리턴 boolean

$resource_type 보호되어 있는 정적으로 프로퍼티

protected static $resource_type

$schema 보호되어 있는 프로퍼티

protected $schema

$update_only 공개적으로 프로퍼티

Property that will prevent a model being created if its set to true.
public bool $update_only
리턴 boolean

$version 보호되어 있는 프로퍼티

protected $version

$warn_errors 공개적으로 프로퍼티

Flag that will force all errors on the resource to be mapped to warnings.
public bool $warn_errors
리턴 boolean

$warnings 공개적으로 프로퍼티

public $warnings