DropdownTranslation::getTranslationsForAnItem PHP Method

getTranslationsForAnItem() static public method

Get translations for an item
static public getTranslationsForAnItem ( $itemtype, $items_id, $field ) : the
$itemtype itemtype
$items_id item ID
$field the field for which the translation is needed
return the value translated if a translation is available, or the same value if not
    static function getTranslationsForAnItem($itemtype, $items_id, $field)
    {
        global $DB;
        $query = "SELECT *\n                  FROM `" . self::getTable() . "`\n                  WHERE `itemtype` = '{$itemtype}'\n                    AND `items_id` = '{$items_id}'\n                    AND `field` = '{$field}'";
        $data = array();
        foreach ($DB->request($query) as $tmp) {
            $data[$tmp['id']] = $tmp;
        }
        return $data;
    }