get thirdparty's contacts as Contact objects
This commit is contained in:
parent
0b09493ecb
commit
e0295cefc1
@ -1665,6 +1665,41 @@ class Societe extends CommonObject
|
||||
return $contacts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Renvoie la liste des contacts de cette societe
|
||||
*
|
||||
* @return array $contacts tableau des contacts
|
||||
*/
|
||||
function contact_array_objects()
|
||||
{
|
||||
require_once DOL_DOCUMENT_ROOT . '/contact/class/contact.class.php';
|
||||
$contacts = array();
|
||||
|
||||
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."socpeople WHERE fk_soc = '".$this->id."'";
|
||||
$resql=$this->db->query($sql);
|
||||
if ($resql)
|
||||
{
|
||||
$nump = $this->db->num_rows($resql);
|
||||
if ($nump)
|
||||
{
|
||||
$i = 0;
|
||||
while ($i < $nump)
|
||||
{
|
||||
$obj = $this->db->fetch_object($resql);
|
||||
$contact = new Contact($this->db);
|
||||
$contact->fetch($obj->rowid);
|
||||
$contacts[] = $contact;
|
||||
$i++;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dol_print_error($this->db);
|
||||
}
|
||||
return $contacts;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return property of contact from its id
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user