Elgg
Version master
|
Interfaces with the database to perform CRUD operations on annotations. More...
Public Member Functions | |
__construct (protected Database $db, protected EventsService $events) | |
Constructor. More... | |
get (int $id) | |
Get a specific annotation by its id. More... | |
delete (\ElggAnnotation $annotation) | |
Deletes an annotation using its ID. More... | |
create (\ElggAnnotation $annotation,\ElggEntity $entity) | |
Create a new annotation and return its ID. More... | |
update (\ElggAnnotation $annotation) | |
Store updated annotation in the database. More... | |
find (array $options=[]) | |
Returns annotations. More... | |
deleteAll (array $options) | |
Deletes annotations based on $options. More... | |
exists (int $entity_guid, string $name, int $owner_guid) | |
Check to see if a user has already created an annotation on an object. More... | |
Public Attributes | |
const | TABLE_NAME = 'annotations' |
const | DEFAULT_JOIN_ALIAS = 'a_table' |
Protected Member Functions | |
isValidOptionsForBatchOperation (array $options) | |
Checks if there are some constraints on the options array for potentially dangerous operations. More... | |
Interfaces with the database to perform CRUD operations on annotations.
Definition at line 15 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::__construct | ( | protected Database | $db, |
protected EventsService | $events | ||
) |
Constructor.
Database | $db | Database |
EventsService | $events | Events |
Definition at line 29 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::create | ( | \ElggAnnotation | $annotation, |
\ElggEntity | $entity | ||
) |
Create a new annotation and return its ID.
\ElggAnnotation | $annotation | Annotation |
\ElggEntity | $entity | Entity being annotated |
Definition at line 89 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::delete | ( | \ElggAnnotation | $annotation | ) |
Deletes an annotation using its ID.
\ElggAnnotation | $annotation | Annotation |
Definition at line 58 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::deleteAll | ( | array | $options | ) |
Deletes annotations based on $options.
array | $options | Options |
Definition at line 215 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::exists | ( | int | $entity_guid, |
string | $name, | ||
int | $owner_guid | ||
) |
Check to see if a user has already created an annotation on an object.
int | $entity_guid | Entity guid |
string | $name | Annotation name |
int | $owner_guid | Owner guid |
Definition at line 275 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::find | ( | array | $options = [] | ) |
Returns annotations.
Accepts all elgg_get_entities() options
array | $options | Options |
Definition at line 194 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::get | ( | int | $id | ) |
Get a specific annotation by its id.
int | $id | The id of the annotation object |
Definition at line 39 of file AnnotationsTable.php.
|
protected |
Checks if there are some constraints on the options array for potentially dangerous operations.
array | $options | options to check |
Definition at line 248 of file AnnotationsTable.php.
Elgg\Database\AnnotationsTable::update | ( | \ElggAnnotation | $annotation | ) |
Store updated annotation in the database.
\ElggAnnotation | $annotation | Annotation to store |
Definition at line 152 of file AnnotationsTable.php.
const Elgg\Database\AnnotationsTable::DEFAULT_JOIN_ALIAS = 'a_table' |
Definition at line 21 of file AnnotationsTable.php.
const Elgg\Database\AnnotationsTable::TABLE_NAME = 'annotations' |
Definition at line 19 of file AnnotationsTable.php.