PHP 클래스 Shanty_Mongo_Document

저자: Coen Hyde
상속: extends Shanty_Mongo_Collection, implements ArrayAccess, implements Countable, implements IteratorAggregate
파일 보기 프로젝트 열기: coen-hyde/shanty-mongo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_cleanData
$_config
$_data
$_docRequirements
$_filters
$_operations
$_references
$_requirements
$_validators

공개 메소드들

메소드 설명
__construct ( $data = [], $config = [] )
__get ( $property ) : mixed Get a property
__isset ( string $property ) Test to see if a property is set
__set ( string $property, mixed $value ) Set a property
__unset ( string $property ) Unset a property
_getMongoCollection ( boolean $writable = true ) : MongoCollection Fetch an instance of MongoCollection
_getMongoDb ( boolean $writable = true ) : MongoDb Fetch an instance of MongoDb
addOperation ( string $operation, $property = null, $value = null ) Add an operation
addRequirement ( string $property, string $requirement, $options = null ) Add a requirement to a property
addToSet ( $property, $value ) * Adds value to the array only if its not in the array already.
applyRequirements ( array $requirements, $dirty = true ) Apply a set of requirements
count ( ) : integer Count all properties in this document
createReference ( ) : array Create a reference to this document
delete ( $safe = true ) Delete this document
export ( $skipRequired = false ) : array Export all data
getConfigAttribute ( string $attribute ) Get a config attribute
getCriteria ( string $property = null ) : mixed Get criteria
getFilters ( String $property ) : Zend_Filter Get all filters attached to a property
getId ( ) : MongoId Get this document's id
getInheritance ( ) : array Get the inheritance of this document
getIterator ( ) : Shanty_Mongo_DocumentIterator Get the document iterator
getOperations ( boolean $includingChildren = false ) Get all operations
getPathToDocument ( ) : string Get the path to this document from the root document
getPathToProperty ( $property ) : string Get the full path from the root document to a property
getPropertiesWithRequirement ( array $requirement ) Get all the properties with a particular requirement
getProperty ( mixed $property ) Get a property
getPropertyKeys ( ) Get a list of all property keys in this document
getRequirements ( string $prefix = null ) Get all requirements. If prefix is provided then only the requirements for the properties that start with prefix will be returned.
getValidators ( String $property ) : Zend_Validate Get all validators attached to a property
hasConfigAttribute ( string $attribute ) Determine if a config attribute is set
hasCriteria ( $property ) : boolean Determine if the document has certain criteria
hasId ( ) : boolean Does this document have an id
hasKey ( ) : boolean Determine if this document has a key
hasProperty ( $property ) : boolean Determine if this document has a property
hasReference ( $referenceName ) : boolean Determine if the document has a given reference or not
hasRequirement ( string $property, string $requirement ) Test if this document has a particular requirement
inc ( string $property, integer $value = 1 ) Increment a property by a specified amount
isConnected ( ) Is this document connected to a db and collection
isEmpty ( ) : boolean Test to see if this document is empty
isLocked ( ) : boolean Is this document locked
isNewDocument ( ) : boolean Is this document a new document
isParentDocumentSet ( ) : boolean Is this document a child element of a document set
isReference ( Shanty_Mongo_Document $document ) : boolean Test to see if a document is a reference in this document
isRootDocument ( ) : boolean Is this document a root document
isValid ( String $property, boolean $value ) Test if a value is valid against a property
loadRequirements ( String $property ) : boolean Load the requirements as validators or filters for a given property, and cache them as validators or filters, respectively.
offsetExists ( string $offset ) Test to see if an offset exists
offsetGet ( string $offset ) : mixed Get an offset
offsetSet ( string $offset, mixed $value ) set an offset
offsetUnset ( string $offset ) Unset a property
pop ( $property, $value ) * Removes an element from an array
processChanges ( array $data = [] ) Convert data changes into operations
pull ( string $property, mixed $value ) Pull all occurrences a value from an array
purgeOperations ( boolean $includingChildren = false ) Remove all operations
push ( string $property = null, mixed $value = null ) Push a value to a property
removeIgnoredProperties ( &$exportData ) : void Removes any properties that have been flagged as ignore in properties.
removeRequirement ( string $property, string $requirement ) Remove a requirement from a property
save ( boolean $entierDocument = false, boolean $safe = true ) : boolean Save this document
saveUnsafe ( boolean $entierDocument = false ) : boolean Save this document without waiting for a response from the server
setConfigAttribute ( string $attribute, unknown_type $value ) Set a config attribute
setCriteria ( string $property = null, $value = null ) Add criteria
setId ( MongoId $id ) : MongoId Set this document's id
setPathToDocument ( unknown_type $path ) Set the path to this document from the root document
setProperty ( mixed $property, mixed $value ) Set a property

보호된 메소드들

메소드 설명
init ( )
postDelete ( )
postInsert ( )
postSave ( )
postUpdate ( )
preDelete ( )
preInsert ( )
preSave ( )
preUpdate ( )

메소드 상세

__construct() 공개 메소드

public __construct ( $data = [], $config = [] )

__get() 공개 메소드

Get a property
public __get ( $property ) : mixed
$property
리턴 mixed

__isset() 공개 메소드

Test to see if a property is set
public __isset ( string $property )
$property string

__set() 공개 메소드

Set a property
public __set ( string $property, mixed $value )
$property string
$value mixed

__unset() 공개 메소드

Unset a property
public __unset ( string $property )
$property string

_getMongoCollection() 공개 메소드

Fetch an instance of MongoCollection
public _getMongoCollection ( boolean $writable = true ) : MongoCollection
$writable boolean
리턴 MongoCollection

_getMongoDb() 공개 메소드

Fetch an instance of MongoDb
public _getMongoDb ( boolean $writable = true ) : MongoDb
$writable boolean
리턴 MongoDb

addOperation() 공개 메소드

Add an operation
public addOperation ( string $operation, $property = null, $value = null )
$operation string

addRequirement() 공개 메소드

Add a requirement to a property
public addRequirement ( string $property, string $requirement, $options = null )
$property string
$requirement string

addToSet() 공개 메소드

* Adds value to the array only if its not in the array already.
public addToSet ( $property, $value )
$property
$value

applyRequirements() 공개 메소드

Apply a set of requirements
public applyRequirements ( array $requirements, $dirty = true )
$requirements array

count() 공개 메소드

Count all properties in this document
public count ( ) : integer
리턴 integer

createReference() 공개 메소드

Create a reference to this document
public createReference ( ) : array
리턴 array

delete() 공개 메소드

$return boolean Result of delete
public delete ( $safe = true )

export() 공개 메소드

Export all data
public export ( $skipRequired = false ) : array
리턴 array

getConfigAttribute() 공개 메소드

Get a config attribute
public getConfigAttribute ( string $attribute )
$attribute string

getCriteria() 공개 메소드

Get criteria
public getCriteria ( string $property = null ) : mixed
$property string
리턴 mixed

getFilters() 공개 메소드

Get all filters attached to a property
public getFilters ( String $property ) : Zend_Filter
$property String
리턴 Zend_Filter

getId() 공개 메소드

Get this document's id
public getId ( ) : MongoId
리턴 MongoId

getInheritance() 공개 메소드

Get the inheritance of this document
public getInheritance ( ) : array
리턴 array

getIterator() 공개 메소드

Get the document iterator
public getIterator ( ) : Shanty_Mongo_DocumentIterator
리턴 Shanty_Mongo_DocumentIterator

getOperations() 공개 메소드

Get all operations
public getOperations ( boolean $includingChildren = false )
$includingChildren boolean Get operations from children as well

getPathToDocument() 공개 메소드

Get the path to this document from the root document
public getPathToDocument ( ) : string
리턴 string

getPathToProperty() 공개 메소드

Get the full path from the root document to a property
public getPathToProperty ( $property ) : string
$property
리턴 string

getPropertiesWithRequirement() 공개 메소드

Get all the properties with a particular requirement
public getPropertiesWithRequirement ( array $requirement )
$requirement array

getProperty() 공개 메소드

Get a property
public getProperty ( mixed $property )
$property mixed

getPropertyKeys() 공개 메소드

Get a list of all property keys in this document
public getPropertyKeys ( )

getRequirements() 공개 메소드

Get all requirements. If prefix is provided then only the requirements for the properties that start with prefix will be returned.
public getRequirements ( string $prefix = null )
$prefix string

getValidators() 공개 메소드

Get all validators attached to a property
public getValidators ( String $property ) : Zend_Validate
$property String Name of property
리턴 Zend_Validate

hasConfigAttribute() 공개 메소드

Determine if a config attribute is set
public hasConfigAttribute ( string $attribute )
$attribute string

hasCriteria() 공개 메소드

Determine if the document has certain criteria
public hasCriteria ( $property ) : boolean
리턴 boolean

hasId() 공개 메소드

Does this document have an id
public hasId ( ) : boolean
리턴 boolean

hasKey() 공개 메소드

Determine if this document has a key
public hasKey ( ) : boolean
리턴 boolean

hasProperty() 공개 메소드

Determine if this document has a property
public hasProperty ( $property ) : boolean
$property
리턴 boolean

hasReference() 공개 메소드

Determine if the document has a given reference or not
public hasReference ( $referenceName ) : boolean
리턴 boolean

hasRequirement() 공개 메소드

Test if this document has a particular requirement
public hasRequirement ( string $property, string $requirement )
$property string
$requirement string

inc() 공개 메소드

Increment a property by a specified amount
public inc ( string $property, integer $value = 1 )
$property string
$value integer

init() 보호된 메소드

protected init ( )

isConnected() 공개 메소드

Is this document connected to a db and collection
public isConnected ( )

isEmpty() 공개 메소드

Test to see if this document is empty
public isEmpty ( ) : boolean
리턴 boolean

isLocked() 공개 메소드

Is this document locked
public isLocked ( ) : boolean
리턴 boolean

isNewDocument() 공개 메소드

Is this document a new document
public isNewDocument ( ) : boolean
리턴 boolean

isParentDocumentSet() 공개 메소드

Is this document a child element of a document set
public isParentDocumentSet ( ) : boolean
리턴 boolean

isReference() 공개 메소드

Test to see if a document is a reference in this document
public isReference ( Shanty_Mongo_Document $document ) : boolean
$document Shanty_Mongo_Document
리턴 boolean

isRootDocument() 공개 메소드

Is this document a root document
public isRootDocument ( ) : boolean
리턴 boolean

isValid() 공개 메소드

Test if a value is valid against a property
public isValid ( String $property, boolean $value )
$property String
$value boolean

loadRequirements() 공개 메소드

Load the requirements as validators or filters for a given property, and cache them as validators or filters, respectively.
public loadRequirements ( String $property ) : boolean
$property String Name of property
리턴 boolean whether or not cache was used.

offsetExists() 공개 메소드

Test to see if an offset exists
public offsetExists ( string $offset )
$offset string

offsetGet() 공개 메소드

Get an offset
public offsetGet ( string $offset ) : mixed
$offset string
리턴 mixed

offsetSet() 공개 메소드

set an offset
public offsetSet ( string $offset, mixed $value )
$offset string
$value mixed

offsetUnset() 공개 메소드

Unset a property
public offsetUnset ( string $offset )
$offset string

pop() 공개 메소드

* Removes an element from an array
public pop ( $property, $value )
$property
$value

postDelete() 보호된 메소드

protected postDelete ( )

postInsert() 보호된 메소드

protected postInsert ( )

postSave() 보호된 메소드

protected postSave ( )

postUpdate() 보호된 메소드

protected postUpdate ( )

preDelete() 보호된 메소드

protected preDelete ( )

preInsert() 보호된 메소드

protected preInsert ( )

preSave() 보호된 메소드

protected preSave ( )

preUpdate() 보호된 메소드

protected preUpdate ( )

processChanges() 공개 메소드

Convert data changes into operations
public processChanges ( array $data = [] )
$data array

pull() 공개 메소드

Pull all occurrences a value from an array
public pull ( string $property, mixed $value )
$property string
$value mixed

purgeOperations() 공개 메소드

Remove all operations
public purgeOperations ( boolean $includingChildren = false )
$includingChildren boolean Remove operations from children as wells

push() 공개 메소드

Push a value to a property
public push ( string $property = null, mixed $value = null )
$property string
$value mixed

removeIgnoredProperties() 공개 메소드

Removes any properties that have been flagged as ignore in properties.
저자: Tom Holder
public removeIgnoredProperties ( &$exportData ) : void
리턴 void

removeRequirement() 공개 메소드

Remove a requirement from a property
public removeRequirement ( string $property, string $requirement )
$property string
$requirement string

save() 공개 메소드

Save this document
public save ( boolean $entierDocument = false, boolean $safe = true ) : boolean
$entierDocument boolean Force the saving of the entier document, instead of just the changes
$safe boolean If FALSE, the program continues executing without waiting for a database response. If TRUE, the program will wait for the database response and throw a MongoCursorException if the update did not succeed
리턴 boolean Result of save

saveUnsafe() 공개 메소드

Save this document without waiting for a response from the server
public saveUnsafe ( boolean $entierDocument = false ) : boolean
$entierDocument boolean Force the saving of the entier document, instead of just the changes
리턴 boolean Result of save

setConfigAttribute() 공개 메소드

Set a config attribute
public setConfigAttribute ( string $attribute, unknown_type $value )
$attribute string
$value unknown_type

setCriteria() 공개 메소드

Add criteria
public setCriteria ( string $property = null, $value = null )
$property string

setId() 공개 메소드

Set this document's id
public setId ( MongoId $id ) : MongoId
$id MongoId
리턴 MongoId

setPathToDocument() 공개 메소드

Set the path to this document from the root document
public setPathToDocument ( unknown_type $path )
$path unknown_type

setProperty() 공개 메소드

Set a property
public setProperty ( mixed $property, mixed $value )
$property mixed
$value mixed

프로퍼티 상세

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

protected $_cleanData

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

protected $_config

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

protected $_data

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

protected $_docRequirements

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

protected $_filters

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

protected $_operations

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

protected $_references

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

protected static $_requirements

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

protected $_validators