/** * Return all the fields within a given table identified by its name. * @param string|\dbeurive\Backend\Database\EntryPoints\Description\Element\Table $inTable Name of the table, or object that represents the table. * @return array The method returns the list of fields within the table identified by the given name. */ public static function getNamesByTable($inTable) { $inTable = is_a($inTable, Table::getFullyQualifiedClassName()) ? $inTable->getName() : $inTable; $res = []; $repository = parent::getRepositoryForClass(__CLASS__); foreach ($repository as $_name => $_field) { $tokens = explode('.', $_name); if ($tokens[0] == $inTable) { $res[] = $_name; } } return $res; }