2 /************************************************************************
3 address.php - Copyright duhlman
5 /usr/share/apps/umbrello/headings/heading.php
7 This file was generated on %date% at %time%
8 The original location of this file is /home/duhlman/uml-generated-code/prescription.php
9 **************************************************************************/
15 class Company
extends ORDataObject
29 * Constructor sets all Company attributes to their default value
31 function __construct($id = "", $foreign_id = "")
35 $this->foreign_id
= $foreign_id;
36 $this->_table
= "companies";
42 $this->plus_four
= "";
43 $this->country
= "USA";
48 function factory_company($foreign_id = "")
50 if (empty($foreign_id)) {
51 $foreign_id= "like '%'";
53 $foreign_id= " = '" . add_escape_custom(strval($foreign_id)) . "'";
57 $sql = "SELECT id FROM " . $a->_table
. " WHERE foreign_id " .$foreign_id ;
58 //echo $sql . "<bR />";
59 $results = sqlQ($sql);
61 $row = sqlFetchArray($results);
63 $a = new Address($row['id']);
69 function toString($html = false)
72 . "ID: " . $this->id
."\n"
73 . "FID: " . $this->foreign_id
."\n"
76 .$this->city
. ", " . strtoupper($this->state
) . " " . $this->zip
. "-" . $this->plus_four
. "\n"
77 .$this->country
. "\n";
80 return nl2br($string);
94 function set_name($name)
102 function set_foreign_id($fid)
104 $this->foreign_id
= $fid;
106 function get_foreign_id()
108 return $this->foreign_id
;
110 function set_line1($line1)
112 $this->line1
= $line1;
118 function set_line2($line2)
120 $this->line2
= $line2;
126 function set_city($city)
134 function set_state($state)
136 $this->state
= $state;
142 function set_zip($zip)
150 function set_plus_four($plus_four)
152 $this->plus_four
= $plus_four;
154 function get_plus_four()
156 return $this->plus_four
;
158 function set_country($country)
160 $this->country
= $country;
162 function get_country()
164 return $this->country
;
166 function persist($fid = "")
169 $this->foreign_id
= $fid;