/** * @param integer $id * @return array */ public function getClientWithIP($id) { $select = $this->select()->where('id = ?', intval($id)); $data = $this->fetchRow($select)->toArray(); $ipRelation = new WsClientHasWsSaveip(); $ipRow = $ipRelation->getIpByClient(intval($id)); $ipAddress = array(); if ($ipRow) { $array = $ipRow->toArray(); foreach ($array as $val) { $ipAddress[] = $val['ws_saveip_id']; } } $data['ip_address'] = $ipAddress; return $data; }