add_filter (line
319)
Declare a filter implementation.
Declare a filter implementation.
void
add_filter
(string|array $filterName, callback $callback, [integer $priority = 10])
-
string|array
$filterName
-
callback
$callback
-
integer
$priority: Optional Defaults to 10.
add_mime_display_type (line
281)
Declare a function that will be used to display files with a given MIME type.
Declare a function that will be used to display files with a given MIME type.
void
add_mime_display_type
( $mimeTypes, $callback, [ $options = array()])
-
$mimeTypes
-
$callback
-
array
$options
add_plugin_hook (line
166)
Declare a plugin hook implementation within a plugin.
Declare a plugin hook implementation within a plugin.
void
add_plugin_hook
(string $hook, mixed $callback)
-
mixed
$callback: Any valid PHP callback.
-
string
$hook
apply_filters (line
299)
Apply a set of plugin filters to a given value.
Apply a set of plugin filters to a given value.
The first two arguments represent the name of the filter and the value to filter, and all subsequent arguments are passed to the individual filter implementations.
mixed
apply_filters
(string|array $filterName, mixed $valueToFilter)
-
string|array
$filterName
-
mixed
$valueToFilter
current_user (line
110)
Retrieve the User record associated with the currently logged in user.
Retrieve the User record associated with the currently logged in user.
User|null
current_user
()
debug (line
134)
Log a message with 'DEBUG' priority.
Log a message with 'DEBUG' priority.
This will do nothing if logging is not enabled via config.ini's log.errors setting.
void
debug
(string $msg)
delete_option (line
53)
Delete an option from the database.
Delete an option from the database.
void
delete_option
(string $name)
generate_slug (line
78)
Generate a URL slug from a piece of text.
Generate a URL slug from a piece of text.
Trims whitespace, replaces some prohibited characters with hyphens, and converts the resulting string to lowercase.
string
generate_slug
(string $text)
get_acl (line
331)
Retrieve the ACL object.
Retrieve the ACL object.
get_db (line
120)
Retrieve the database object.
Retrieve the database object.
get_option (line
20)
Retrieve an option from the Omeka database.
Retrieve an option from the Omeka database.
If the returned value represents an object or array, it must be unserialized by the caller before use. For example,
.
string
get_option
(string $name)
get_plugin_hook_output (line
203)
Retrieve the output of fire_plugin_hook() as a string.
Retrieve the output of fire_plugin_hook() as a string.
This is invoked in the same way as fire_plugin_hook().
string
get_plugin_hook_output
()
get_plugin_ini (line
268)
Retrieves specified descriptive info for a plugin from its ini file.
Retrieves specified descriptive info for a plugin from its ini file.
null
get_plugin_ini
(string $pluginDirName, string $iniKeyName)
-
string
$pluginDirName: The directory name of the plugin
-
string
$iniKeyName: The name of the key in the ini file
get_specific_plugin_hook_output (line
224)
Retrieve the output of a specific plugin's hook as a string.
Retrieve the output of a specific plugin's hook as a string.
This is like get_plugin_hook_output() but only calls the hook within the provided plugin.
string
get_specific_plugin_hook_output
(string $pluginName, string $hookName, [any 2)
-
string
$pluginName
-
string
$hookName
-
[any
2: number of further arguments]
insert_collection (line
547)
Inserts a collection
Inserts a collection
void
insert_collection
([array $metadata = array()])
-
array
$metadata: Follows the format:
array(
'name' => [string],
'description'=> [string],
'public' => [true|false],
'featured' => [true|false]
'collectors' => [array of entities, entity ids, or entity property arrays]
)
You can specify collectors in several ways.
You can provide an array of entity properties:
array('first_name' => $entityFirstName1,
'middle_name' => $entityMiddleName1,
'last_name' => $entityLastName1,
...
),
array('first_name' => $entityFirstName2,
'middle_name' => $entityMiddleName2,
'last_name' => $entityLastName2,
...
),
array(...),
...
));
Alternatively, you can use an array of entity objects or entity ids.
insert_collection(array('collectors'=>array($entity1, $entity2, ...)); insert_collection(array('collectors'=>array($entityId1, $entityId2, ...));
Also you can mix the parameters:
array('first_name' => $entityFirstName1,
'middle_name' => $entityMiddleName1,
'last_name' => $entityLastName1,
...
),
$entity2,
$entityId3,
...
));
insert_element_set (line
586)
Insert an element set and its elements into the database.
Insert an element set and its elements into the database.
ElementSet
insert_element_set
([
string|array $elementSetMetadata =
array()], [
$elements =
array()])
-
string|array
$elementSetMetadata: Element set information.
[(string) element set name]
-OR-
array(
'name' => [(string) element set name, required, unique],
'description' => [(string) element set description, optional]
);
-
array
$elements: An array containing element data. Follows one of more of the following formats:
- An array containing element metadata
- A string of the element name
array(
array(
'name' => [(string) name, required],
'description' => [(string) description, optional],
'record_type' => [(string) record type name, optional],
'data_type' => [(string) data type name, optional],
'record_type_id' => [(int) record type id, optional],
'data_type_id' => [(int) data type id, optional]
),
[(string) element name]
);
insert_files_for_item (line
433)
Add files to an item.
Add files to an item.
insert_item (line
415)
Insert a new item into the Omeka database.
Insert a new item into the Omeka database.
* @param array $itemMetadata Optional Set of metadata options for configuring the item. Array which can include the following properties:
- 'public' (boolean)
- 'featured' (boolean)
- 'collection_id' (integer)
- 'item_type_id' (integer)
- 'item_type_name' (string)
- 'tags' (string, comma-delimited)
- 'tag_entity' (Entity, optional and only checked if 'tags' is given)
- 'overwriteElementTexts' (boolean) -- determines whether or not to
overwrite existing element texts. If true, this will loop through the
element texts provided in $elementTexts, and it will update existing
records where possible. All texts that are not yet in the DB will be
added in the usual manner. False by default.
Item
insert_item
([
$metadata =
array()], [
array $elementTexts =
array()], [
array $fileMetadata =
array()])
-
array
$elementTexts: Optional Array of element texts to assign to the item. This follows the format:
array(
[element set name] => array(
[element name] => array(
array('text' => [string], 'html' => [false|true]),
array('text' => [string], 'html' => [false|true])
),
[element name] => array(
array('text' => [string], 'html' => [false|true]),
array('text' => [string], 'html' => [false|true])
)
),
[element set name] => array(
[element name] => array(
array('text' => [string], 'html' => [false|true]),
array('text' => [string], 'html' => [false|true])
),
[element name] => array(
array('text' => [string], 'html' => [false|true]),
array('text' => [string], 'html' => [false|true])
)
)
);
See ActsAsElementText::addElementTextsByArray() for more info.
-
array
$fileMetadata: Optional Set of metadata options that allow one or more files to be associated with the item. Includes the following options:
- 'file_transfer_type' (string = 'Url|Filesystem|Upload' or
Omeka_File_Transfer_Adapter_Interface). Corresponds to the
$transferStrategy argument for addFiles().
- 'file_ingest_options' OPTIONAL (array of possible options to pass
modify the behavior of the ingest script). Corresponds to the $options
argument for addFiles().
- 'files' (array or string) Represents information indicating the file
to ingest. Corresponds to the $files argument for addFiles().
-
$metadata
insert_item_type (line
488)
Insert a new item type.
Insert a new item type.
ItemType
insert_item_type
([
array $metadata =
array()], [
array $elementInfos =
array()])
-
array
$metadata: Follows the format:
array(
'name' => [string],
'description'=> [string]
)
-
array
$elementInfos: An array containing element data. Each entry follows one or more of the following formats:
- An array containing element metadata
- A string containing the element name
array(
array(
'name' => [(string) name, required],
'description' => [(string) description, optional],
'record_type' => [(string) record type name, optional],
'data_type' => [(string) data type name, optional],
'order' => [(int) order, optional],
'record_type_id' => [(int) record type id, optional],
'data_type_id' => [(int) data type id, optional]
),
[(string) element name],
);
is_admin_theme (line
346)
Determine whether or not the script is being executed through the administrative interface.
Determine whether or not the script is being executed through the administrative interface.
Can be used to branch behavior based on whether or not the admin theme is being accessed, but should not be relied upon in place of using the ACL for controlling access to scripts.
boolean
is_admin_theme
()
is_true (line
633)
Returns whether a value is true or not.
Returns whether a value is true or not. If the value is a string and its lowercased value is 'true' or '1', it returns true. If the value is an integer and equal to 1, then it returns true. Otherwise it returns false.
boolean
is_true
(string $value)
not_empty_or (line
618)
Return either the value or, if it's empty, output the default.
Return either the value or, if it's empty, output the default.
mixed
not_empty_or
(mixed $value, mixed $default)
-
mixed
$value
-
mixed
$default
pluck (line
96)
Retrieve one column of a multidimensional array as an array.
Retrieve one column of a multidimensional array as an array.
array
pluck
(string|integer $col, array $array)
-
string|integer
$col
-
array
$array
release_object (line
601)
Releases an object from memory.
Releases an object from memory.
Use this fuction after you are done using an Omeka model object to prevent memory leaks. Required because PHP 5.2 does not do garbage collection on circular references.
void
release_object
(mixed &$var)
set_option (line
35)
Set an option in the Omeka database.
Set an option in the Omeka database.
Note that objects and arrays must be serialized before being saved.
void
set_option
(string $name, string $value)
-
string
$name
-
string
$value
update_item (line
449)
Item
update_item
(
Item|int $item, [
array $metadata =
array()], [
array $elementTexts =
array()], [
array $fileMetadata =
array()])
-
Item|int
$item: Either an Item object or the ID for the item.
-
array
$metadata: Set of options that can be passed to the item.
-
array
$elementTexts
-
array
$fileMetadata