/**
  * gets a list of all agents related to all schemas
  *
  * @return array Agents
  * @param  var_type $var
  */
 public static function getSchemaAgents()
 {
     $results = array();
     $c = new Criteria();
     $c->clearSelectColumns();
     $c->addSelectColumn(self::AGENT_ID);
     $c->addJoin(self::AGENT_ID, AgentPeer::ID);
     $c->addAscendingOrderByColumn(AgentPeer::ORG_NAME);
     $c->setDistinct();
     $rs = self::doSelectRS($c);
     while ($rs->next()) {
         $results[] = AgentPeer::retrieveByPK($rs->getInt(1));
     }
     return $results;
 }
Example #2
0
      $showHistoryBc = true;

    }
  }
*/
//this section determines which breadcrumbs to show with which tab
//it also retrieves the necessary objects for each breadcrumb
//it also sets the object id to use in each tab link when displaying the tabs
switch ($buildBc) {
    case 'agent':
        $showBc = true;
        $showAgentBc = true;
        if (!isset($agent)) {
            $id = 'show' == $action ? $sf_params->get('id') : $paramId;
            if ($id) {
                $agent = AgentPeer::retrieveByPK($id);
            }
        }
        $objectId = $agent ? $agent->getID() : "";
        break;
    case 'agentuser':
        $showBc = true;
        $showAgentBc = true;
        $showAgentUserBc = true;
        if (!isset($agent_has_user)) {
            $id = 'show' == $action ? $sf_params->get('id') : $paramId;
            if ($id) {
                $agent_has_user = AgentHasUserPeer::retrieveByPK($id);
            }
        }
        $objectId = $agent_has_user->getID();
 /**
  * Get the associated Agent object
  *
  * @param      Connection Optional Connection object.
  * @return     Agent The associated Agent object.
  * @throws     PropelException
  */
 public function getAgent($con = null)
 {
     if ($this->aAgent === null && $this->agent_id !== null) {
         // include the related Peer class
         include_once 'lib/model/om/BaseAgentPeer.php';
         $this->aAgent = AgentPeer::retrieveByPK($this->agent_id, $con);
         /* The following can be used instead of the line above to
         		   guarantee the related object contains a reference
         		   to this object, but this level of coupling
         		   may be undesirable in many circumstances.
         		   As it can lead to a db query with many results that may
         		   never be used.
         		   $obj = AgentPeer::retrieveByPK($this->agent_id, $con);
         		   $obj->addAgents($this);
         		 */
     }
     return $this->aAgent;
 }
 /**
  * description
  *
  * @return agent Current agent object
  * @param  integer $agentId
  */
 public static function setLatestagent($agentId)
 {
     $agentObj = AgentPeer::retrieveByPK($agentId);
     if ($agentObj) {
         sfContext::getInstance()->getUser()->setCurrentagent($agentObj);
     }
     return $agentObj;
 }