\Localgod\Tick\StorageSolrStorage

Tick SOLR storage

Basic CRUD operations on SOLR based active records.

Summary

Methods
Properties
Constants
__construct()
getConnection()
closeConnection()
get()
insert()
update()
remove()
exists()
count()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
getQuery()
$connection
N/A

Properties

$connection

$connection : \SolrClient

Database connection

Type

\SolrClient

Methods

__construct()

__construct(\SolrClient  $connection) 

Set the database connection

Parameters

\SolrClient $connection

Database connection

getConnection()

getConnection() : \SolrClient

Get storage connection

Returns

\SolrClient —

A SolrClient instance

closeConnection()

closeConnection() : void

Close storage connection

get()

get(string  $collection, array  $fields, array  $criterias, array  $order = array(), boolean  $direction = true, integer  $limit = null, integer  $offset) : array

Get entities in storage

Parameters

string $collection

Collection to search

array $fields

Properties to fetch

array $criterias

Criterias to search by

array $order

Order result

boolean $direction

Order direction

integer $limit

Limit result

integer $offset

Offset result

Returns

array —

Array with Associative arrays with fieldname=>value

insert()

insert(string  $collection, array  $data) : integer

Insert entity to storage

Parameters

string $collection

Collection to insert into

array $data

Associative array with fieldname=>[value=>value,type=>type]

Returns

integer —

Id of the object inserted @trows SolrClientException|Exception

update()

update(string  $collection, array  $data, array  $criterias) : void

Update entity in storage

Parameters

string $collection

Collection to update

array $data

Associative array with fieldname=>[value=>value,type=>type]

array $criterias

Criteria of the object to update

remove()

remove(string  $collection, array  $criterias) : void

Remove entity from storage

Parameters

string $collection

Collection to search

array $criterias

Criteria of the object to remove

exists()

exists(string  $collection, array  $criterias) : boolean

Entity exists in storage

Parameters

string $collection

Collection to search

array $criterias

Criteria of the object to check for

Returns

boolean

count()

count(string  $collection, array  $criterias) : integer

Count the number of entities matching the given criteria

Parameters

string $collection

Collection to search

array $criterias

Criteria

Returns

integer

getQuery()

getQuery(string  $collection, array  $criterias) : \SolrQuery

Get a SOLR query with the given criterias, on the given collection.

Parameters

string $collection

Collection to search

array $criterias

Criteria

Returns

\SolrQuery