public function habtmFormatter($value, $key)
    {
        if (empty($key) || !ctype_upper($key[0])) {
            return $value;
        }

        if (isset($value[$key])) {
            // $article[Tag][Tag]
            $value = $value[$key];
        }

        if (is_array($value)) {
            return $value;
        }

        $list = explode(',', $value);

        if (empty($list)) {
            return [];
        }

        return array_map('intval', $list);
    }
public function habtmFormatter($value, $key)
    {
        if (empty($key) || !ctype_upper($key[0])) {
            return $value;
        }

        if (isset($value[$key])) {
            // $article[Tag][Tag]
            $value = $value[$key];
        }

        if (is_array($value)) {
            return $value;
        }

        $list = explode(',', $value);

        if (empty($list)) {
            return [];
        }

        return array_map('intval', $list);
    }
public function habtmFormatter ( $ value , $ key ) { if ( empty ( $ key ) || ! ctype_upper ( $ key [ 0 ] ) ) { return $ value ; } if ( isset ( $ value [ $ key ] ) ) { // $article[Tag][Tag] $ value = $ value [ $ key ] ; } if ( is_array ( $ value ) ) { return $ value ; } $ list = explode ( ',' , $ value ) ; if ( empty ( $ list ) ) { return [ ] ; } return array_map ( 'intval' , $ list ) ; }
Converts the string data from HABTM reference into an array of integers.

@param mixed $value The value to convert
@param string $key The field name where the data was stored
@return mixed
Converts the string data from HABTM reference into an array of integers .