# MLA_IPTC_EXIF_Query

Class MLA (Media Library Assistant) IPTC EXIF Query implements the searchable database of IPTC EXIF mapping rules.

package | Media Library Assistant
since | 2.60

### Methods

## Query the plugin_examples items

    _execute_iptc_exif_rules_query( $request) : array

static

since | 2.60

### Arguments

#### $request

``

### Response

`array`

query results; array of MLA post_mime_type objects

## Assemble the in-memory representation of the IPTC EXIF rules

    _get_iptc_exif_rules(boolean $force_refresh = false) : boolean

static

since | 2.60

### Arguments

#### $force_refresh

`boolean`

Optional. Force a reload of rules. Default false.

### Response

`boolean`

Success (true) or failure (false) of the operation

## Sanitize and expand query arguments from request variables

    _prepare_iptc_exif_rules_query( $raw_request,  $offset,  $count) : array

static

since | 2.60

### Arguments

#### $raw_request

``

#### $offset

``

#### $count

``

### Response

`array`

revised arguments suitable for query

## Callback to sort array by a 'name' key.

    _sort_uname_callback(array $a, array $b) : integer

static

since | 2.60

### Arguments

#### $a

`array`

The first array.

#### $b

`array`

The second array.

### Response

`integer`

The comparison result.

## Insert a IPTC EXIF Rule given its value array.

    mla_add_iptc_exif_rule(array $value) : boolean

static

since | 2.60

### Arguments

#### $value

`array`

MLA IPTC EXIF Rule new value.

### Response

`boolean`

true if addition succeeds else false.

## Convert a IPTC EXIF Rule to an old-style mapping rule, given its ID

    mla_convert_iptc_exif_rules(integer|array $rule_ids) : array

static

since | 2.60

### Arguments

#### $rule_ids

`integer|array`

MLA IPTC EXIF Rule ID(s)

### Response

`array`

MLA iptc_exif_mapping values ( 'standard' => array(), 'taxonomy' => array(), 'custom' => array() )

## Get the total number of MLA iptc_exif_rule objects

    mla_count_iptc_exif_rules( $request) : integer

static

since | 2.60

### Arguments

#### $request

``

### Response

`integer`

Number of MLA iptc_exif_rule objects

## Find a IPTC EXIF Rule given its ID

    mla_find_iptc_exif_rule(integer $ID) : array

static

since | 2.60

### Arguments

#### $ID

`integer`

MLA IPTC EXIF Rule ID

### Response

`array`

MLA iptc_exif_rule array

## Find a IPTC EXIF Rule ID given its rule name

    mla_find_iptc_exif_rule_ID(string $rule_name) : integer

static

since | 2.60

### Arguments

#### $rule_name

`string`

MLA IPTC EXIF Rule name.

### Response

`integer`

Rule ID if the rule exists else zero (0).

## Return the IPTC EXIF custom field rule names

    mla_iptc_exif_rule_names() : array

static

since | 2.60

### Response

`array`

MLA iptc_exif_rule name => name

## Flush the in-memory representation of the IPTC EXIF rules to the option value

    mla_put_iptc_exif_rules()

static

since | 2.60

## Retrieve MLA iptc_exif_rule objects for list table display

    mla_query_iptc_exif_rules( $request,  $offset,  $count) : array

static

since | 2.60

### Arguments

#### $request

``

#### $offset

``

#### $count

``

### Response

`array`

MLA iptc_exif_rule objects

## Replace a IPTC EXIF Rule given its value array.

    mla_replace_iptc_exif_rule(array $value) : boolean

static

since | 2.60

### Arguments

#### $value

`array`

MLA IPTC EXIF Rule new value.

### Response

`boolean`

true if object exists else false.

## Tabulate MLA iptc_exif_rule objects by view for list table display

    mla_tabulate_iptc_exif_items( $s = '') : array

static

since | 2.60

### Arguments

#### $s

``

### Response

`array`

( 'singular' label, 'plural' label, 'count' of items )

## Update a IPTC EXIF Rule property given its ID and key.

    mla_update_iptc_exif_rule(integer $ID, string $key, string $value) : boolean

static

since | 2.60

### Arguments

#### $ID

`integer`

MLA IPTC EXIF Rule ID.

#### $key

`string`

MLA IPTC EXIF Rule property.

#### $value

`string`

MLA IPTC EXIF Rule new value.

### Response

`boolean`

true if object exists else false.

### Properties

## In-memory representation of the IPTC EXIF mapping rules

    _iptc_exif_rules : array

static

since |
var | { Items by ID. Key $$ID is an index number starting with 1.
        @type array $$ID {
            Rule elements.

            @type integer $post_ID Rule ID; equal to $$ID.
            @type string $type Rule type, ‘standard’, ‘taxonomy’ or ‘custom’.
            @type string $key Field or taxonomy slug, custom field name the rule applies to.
            @type string $rule_name Rule name, to accomodate an old custom fields bug.
            @type string $name Field or taxonomy name the rule applies to.
            @type boolean $hierarchical True if taxonomy is hierarchical.
            @type string $iptc_value IPTC tag, e.g., ‘2#025’ or 'none'.
            @type string $exif_value EXIF field name or Content Template begining "template:".
            @type boolean $iptc_first True if IPTC value takes priority over EXIF value.
            @type boolean $keep_existing Retain existing value(s), do not replace them.
            @type string $format Output format, 'native', 'commas' or 'raw'.
            @type string $option Output option, 'text', 'single', 'array' or 'multi'.
            @type boolean $no_null Delete empty (NULL) values.
            @type string $delimiters Term separator(s) for taxonomy rules.
            @type integer $parent Parent term_id for taxonomy rules.
            @type boolean $active True if rule should be applied during mapping.
            @type boolean $read_only True if rule_name !== name, to prevent editing of "old bug" rules.
            @type boolean $changed True if the rule has changed since loading.
            @type boolean $deleted True if the rule has been deleted since loading.
        }

### Type(s)

`array`

## Highest existing IPTC EXIF rule ID value

    _iptc_exif_rule_highest_ID : integer

static

since |
var |

### Type(s)

`integer`