src/Utility/Options.php
protected static function getDefaultDisplayFields(RepositoryInterface $table): array
    {
        /** @var \Cake\ORM\Table */
        $table = $table;

        $result = (array)$table->getPrimaryKey();
        array_push($result, $table->getDisplayField());

        $result = array_merge($result, static::$defaultDisplayFields);

        // remove virtual fields
        foreach ($result as $k => $field) {
            if (!$table->hasField($field)) {
                unset($result[$k]);
            }
        }

        // alias fields
        foreach ($result as $k => $field) {
            $result[$k] = $table->aliasField($field);
        }

        return $result;
    }
protected static function getDefaultDisplayFields(RepositoryInterface $table): array
    {
        /** @var \Cake\ORM\Table */
        $table = $table;

        $result = (array)$table->getPrimaryKey();
        array_push($result, $table->getDisplayField());

        $result = array_merge($result, static::$defaultDisplayFields);

        // remove virtual fields
        foreach ($result as $k => $field) {
            if (!$table->hasField($field)) {
                unset($result[$k]);
            }
        }

        // alias fields
        foreach ($result as $k => $field) {
            $result[$k] = $table->aliasField($field);
        }

        return $result;
    }
protected static function getDefaultDisplayFields ( RepositoryInterface $ table ) : array { /** @var \Cake\ORM\Table */ $ table = $ table ; $ result = ( array ) $ table -> getPrimaryKey ( ) ; array_push ( $ result , $ table -> getDisplayField ( ) ) ; $ result = array_merge ( $ result , static :: $ defaultDisplayFields ) ; // remove virtual fields foreach ( $ result as $ k => $ field ) { if ( ! $ table -> hasField ( $ field ) ) { unset ( $ result [ $ k ] ) ; } } // alias fields foreach ( $ result as $ k => $ field ) { $ result [ $ k ] = $ table -> aliasField ( $ field ) ; } return $ result ; }
Default display fields getter.

@param \Cake\Datasource\RepositoryInterface $table Table instance
@return mixed[]
Default display fields getter .