PHP 클래스 Shanty_Mongo_Collection

저자: Coen Hyde
파일 보기 프로젝트 열기: coen-hyde/shanty-mongo 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$_cachedCollectionInheritance
$_cachedCollectionRequirements
$_collection
$_connectionGroup
$_db
$_documentSetClass
$_requirements

공개 메소드들

메소드 설명
all ( array $query = [], array $fields = [] ) : Shanty_Mongo_Iterator_Cursor Find many documents
create ( array $data = [], boolean $new = true ) Create a new document belonging to this collection
deleteIndex ( string | array $keys ) Delete an index
deleteIndexes ( ) Remove all indexes from this collection
distinct ( String $property, $query = [] ) : array Select distinct values for a property
drop ( ) Drop this collection
ensureIndex ( array $keys, array $options = [] ) Ensure an index
fetchAll ( array $query = [], array $fields = [] ) : Shanty_Mongo_Iterator_Cursor Alias for all
fetchOne ( array $query = [], array $fields = [] ) : Shanty_Mongo_Document Alias for one
find ( MongoId | String $id, array $fields = [] ) : Shanty_Mongo_Document Find a document by id
getCollectionInheritance ( ) Get the inheritance of this collection
getCollectionName ( ) : string Get the name of the mongo collection
getCollectionRequirements ( bolean $inherited = true ) : array Get requirements
getConnection ( $writable = true ) * Get a connection
getConnectionGroupName ( ) : string Get the name of the connection group
getDbName ( ) : string Get the name of the mongo db
getDocumentClass ( ) : string Get the name of the document class
getDocumentSetClass ( ) : string Get the name of the document set class
getIndexInfo ( ) : array Get index information for this collection
getMongoCollection ( $writable = true ) : MongoCollection Get an instance of MongoCollection
getMongoDb ( $writable = true ) : MongoDb Get an instance of MongoDb
hasCollectionName ( ) : boolean Determine if this collection has a collection name set
hasDbName ( ) : boolean Determine if this collection has a database name set
insert ( array $document, array $options = [] ) Insert a document
insertBatch ( array $documents, array $options = [] ) Insert a batch of documents
isDocumentClass ( ) : boolean Is this class a document class
makeRequirementsTidy ( array $requirements ) : array Process requirements to make sure they are in the correct format
mergeRequirements ( $requirements1, $requirements2 ) : array Merge a two sets of requirements together
one ( array $query = [], array $fields = [] ) : Shanty_Mongo_Document Find one document
remove ( array $criteria, array $options = [] ) Remove documents from this collection
update ( array $criteria, array $object, array $options = [] ) Update documents from this collection

메소드 상세

all() 공개 정적인 메소드

Find many documents
public static all ( array $query = [], array $fields = [] ) : Shanty_Mongo_Iterator_Cursor
$query array
$fields array
리턴 Shanty_Mongo_Iterator_Cursor

create() 공개 정적인 메소드

Create a new document belonging to this collection
public static create ( array $data = [], boolean $new = true )
$data array
$new boolean

deleteIndex() 공개 정적인 메소드

Delete an index
public static deleteIndex ( string | array $keys )
$keys string | array

deleteIndexes() 공개 정적인 메소드

Remove all indexes from this collection
public static deleteIndexes ( )

distinct() 공개 정적인 메소드

Select distinct values for a property
public static distinct ( String $property, $query = [] ) : array
$property String
리턴 array

drop() 공개 정적인 메소드

Drop this collection
public static drop ( )

ensureIndex() 공개 정적인 메소드

Ensure an index
public static ensureIndex ( array $keys, array $options = [] )
$keys array
$options array

fetchAll() 공개 정적인 메소드

Alias for all
public static fetchAll ( array $query = [], array $fields = [] ) : Shanty_Mongo_Iterator_Cursor
$query array
$fields array
리턴 Shanty_Mongo_Iterator_Cursor

fetchOne() 공개 정적인 메소드

Alias for one
public static fetchOne ( array $query = [], array $fields = [] ) : Shanty_Mongo_Document
$query array
$fields array
리턴 Shanty_Mongo_Document

find() 공개 정적인 메소드

Find a document by id
public static find ( MongoId | String $id, array $fields = [] ) : Shanty_Mongo_Document
$id MongoId | String
$fields array
리턴 Shanty_Mongo_Document

getCollectionInheritance() 공개 정적인 메소드

Get the inheritance of this collection
public static getCollectionInheritance ( )

getCollectionName() 공개 정적인 메소드

Get the name of the mongo collection
public static getCollectionName ( ) : string
리턴 string

getCollectionRequirements() 공개 정적인 메소드

Get requirements
public static getCollectionRequirements ( bolean $inherited = true ) : array
$inherited bolean Include inherited requirements
리턴 array

getConnection() 공개 정적인 메소드

* Get a connection
public static getConnection ( $writable = true )
$writable should the connection be writable

getConnectionGroupName() 공개 정적인 메소드

Get the name of the connection group
public static getConnectionGroupName ( ) : string
리턴 string

getDbName() 공개 정적인 메소드

Get the name of the mongo db
public static getDbName ( ) : string
리턴 string

getDocumentClass() 공개 정적인 메소드

Get the name of the document class
public static getDocumentClass ( ) : string
리턴 string

getDocumentSetClass() 공개 정적인 메소드

Get the name of the document set class
public static getDocumentSetClass ( ) : string
리턴 string

getIndexInfo() 공개 정적인 메소드

Get index information for this collection
public static getIndexInfo ( ) : array
리턴 array

getMongoCollection() 공개 정적인 메소드

Get an instance of MongoCollection
public static getMongoCollection ( $writable = true ) : MongoCollection
리턴 MongoCollection

getMongoDb() 공개 정적인 메소드

Get an instance of MongoDb
public static getMongoDb ( $writable = true ) : MongoDb
리턴 MongoDb

hasCollectionName() 공개 정적인 메소드

Determine if this collection has a collection name set
public static hasCollectionName ( ) : boolean
리턴 boolean

hasDbName() 공개 정적인 메소드

Determine if this collection has a database name set
public static hasDbName ( ) : boolean
리턴 boolean

insert() 공개 정적인 메소드

Insert a document
public static insert ( array $document, array $options = [] )
$document array
$options array

insertBatch() 공개 정적인 메소드

Insert a batch of documents
public static insertBatch ( array $documents, array $options = [] )
$documents array
$options array

isDocumentClass() 공개 정적인 메소드

Is this class a document class
public static isDocumentClass ( ) : boolean
리턴 boolean

makeRequirementsTidy() 공개 정적인 메소드

Process requirements to make sure they are in the correct format
public static makeRequirementsTidy ( array $requirements ) : array
$requirements array
리턴 array

mergeRequirements() 공개 정적인 메소드

Merge a two sets of requirements together
public static mergeRequirements ( $requirements1, $requirements2 ) : array
리턴 array

one() 공개 정적인 메소드

Find one document
public static one ( array $query = [], array $fields = [] ) : Shanty_Mongo_Document
$query array
$fields array
리턴 Shanty_Mongo_Document

remove() 공개 정적인 메소드

Remove documents from this collection
public static remove ( array $criteria, array $options = [] )
$criteria array
$options array

update() 공개 정적인 메소드

Update documents from this collection
public static update ( array $criteria, array $object, array $options = [] )
$criteria array
$object array
$options array

프로퍼티 상세

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

protected static $_cachedCollectionInheritance

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

protected static $_cachedCollectionRequirements

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

protected static $_collection

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

protected static $_connectionGroup

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

protected static $_db

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

protected static $_documentSetClass

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

protected static $_requirements