/**
* @Entity
* @Table(name="companies",schema="couponsystem")
*/
class Company
{
function __construct($name, $id, $founders, $email, $address, $created_at, $updated_at = null) {
$this->name = $name;
$this->id = $id;
$this->founders = $founders;
$this->email = $email;
$this->address = $address;
$this->created_at = $created_at;
$this->updated_at = $updated_at;
}
/**
*@Id
*@Column(type="bigint",nullable=false)
*/
protected $id;
/**
*@Column(type="string",length=100,unique=true,nullable=false)
*/
protected $name;
/**
*
* @Column(type="array",length=255,nullable=false)
*/
protected $founders;
/**
*
* @Column(type="array",length=100,nullable=false,unique=true)
*/
protected $email;
/**
* @Embedded(class = "Address")
*/
protected $address;
/**
*
* @Column(type="datetime",nullable=false)
*/
protected $created_at;
/**
*
* @Column(type="datetime",nullable=false)
*/
protected $updated_at;
/**
* // Owning side
* @ManyToMany(targetEntity="Coupon",inversedBy="companies")
* @JoinTable(name="company_coupon",joinColumns={@JoinColumn(name="company_id",referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="coupon_id",referencedColumnName="id")})
*/
protected $coupons;
/**
* // Owning side
* @ManyToMany(targetEntity="Customer",inversedBy="companies")
* @JoinTable(name="company_customer",joinColumns={@JoinColumn(name="company_id",referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="customer_id",referencedColumnName="id")})
*/
protected $customers;
/**
* // Owning side
* @ManyToMany(targetEntity="Employee",inversedBy="companies")
* @JoinTable(name="company_employee",joinColumns={@JoinColumn(name="company_id",referencedColumnName="id")},
* inverseJoinColumns={@JoinColumn(name="employee_id",referencedColumnName="id")})
*/
protected $employees;
function setCustomers($customers) {
$this->customers = $customers;
}
function getCustomers() {
return $this->customers;
}
function setCoupons($coupons) {
$this->coupons = $coupons;
}
function getCoupons() {
return $this->coupons;
}
function getCreated_at() {
return $this->created_at;
}
function getUpdated_at() {
return $this->updated_at;
}
function getName() {
return $this->name;
}
function getId() {
return $this->id;
}
function getFounders() {
return $this->founders;
}
function getEmail() {
return $this->email;
}
function getAddress() {
return $this->address;
}
}
You seem to have upset the delicate internal balance of my housekeeper.