Search code examples
symfony-1.4propel

How can I retrieve field in Propel?


I need to get the whole field 'username' from my DB.

Can I do it with model class or Peer-class?

There are many ways to solve that using Query-class, but command propel:build-model didn't create Query-classes. I don't understand why.


Solution

  • Problem is solved. I use

    $users = wiEdmsUserPeer::doSelect(new Criteria())
    

    to get all elements.

    Another way is:

    $criteria = new Criteria();
    $criteria->addSelectColumn($column_name);
    wiEdmsUserPeer::doSelect($criteria);