/** * Check whether a (multi)-column index exists or not on a table * related to this model * @param array $fields * @return bool|array */ public static function indexExists(array $fields = array()) { $tableModifier = self::getTableModifier(); $df = parent::resolveConfiguration(); $check = false; $indexKey = $df['table'] . '___' . implode('__', $fields); $indexList = $tableModifier->listIndex(); if (array_key_exists($indexKey, $indexList)) { $check = $indexList[$indexKey]; } return $check; }