/** * @param IConsultantClient $client * @return void */ public function addPreviousClients(IConsultantClient $client) { $new_order = 0; $clients = $this->getPreviousClients(); if (count($clients) > 0) { $last_one = end($clients); $new_order = $last_one->getOrder() + 1; } $client->setOrder($new_order); $query = new QueryObject(new ConsultantClient()); $query->addOrder(QueryOrder::asc('Order')); AssociationFactory::getInstance()->getOne2ManyAssociation($this, 'PreviousClients', $query)->add($client); }
public static function convertClientToArray(IConsultantClient $client) { $res = array(); $res['name'] = $client->getName(); return $res; }