php - Propel - retrieve all tables -
i have output of schema tables using propel. when referencing particular tablemap
$users = userstablemap::gettablemap(); $map = $users->getdatabasemap(); $tables = $map->gettables(); //yields object, holds users table
is there way not use particular table (e.g. users
) have more general approach? there bit outdated question here faces same problem.
should make custom query or parse schema.xml
retrieve tables?
update
some of solutions given below answers produce empty array
$map = propel::getservicecontainer()->getdatabasemap(); //w & w/o string argument $tables = $map->gettables(); //an empty array
there's no way in current version 2 retrieve table maps 1 call. why: need load table maps incredible slow , have no total "map"/"array" listing available table maps available @ buildtime. in propel3 however, possible.
the solution should follow parsing schema.xml: how check if table names valid in propel?
what can additional reverse real database using reverse classes of propel. however, slow read time whole database structure. see https://github.com/propelorm/propel2/issues/261#issuecomment-40659647
Comments
Post a Comment