<?php
import("com.laurus.core.coreent.LCoreBean");
/**
 * Description of Company
 * @tableName tbl_company
 * @author Kunal Mestri <kunal@laurus-it.com>
 */
class Company extends LCoreBean{
    /**
    * @columnName COMPANY_ID
    * @type int
    * @primary 
    */
    private $id;
    /**
    * @columnName COMPANY_NAME
    * @type string
    */
    private $compname;
    /**
    * @columnName COMPANY_CREATOR
    * @type int
    */
    private $creator;
    /**
    * @columnName COMPANY_WEBSITE
    * @type int
    */
    private $website;
    /**
    * @columnName COMPANY_LANDLINE
    * @type string
    */
    private $landline;
    /**
    * @columnName COMPANY_ADDRESS_ID
    * @type int
    * @compositeEntity COMPANY_ADDRESS_ID
    * @compositeType Address
    */
    private $address;
    /**
    * @columnName COMPANY_BRIEF
    * @type string
    */
    private $brief;
     /**
    * @columnName COMPANY_LANDLINE_2
    * @type int
    */
    private $landline2;
    /**
    * @columnName COMPANY_CREATED_DATE
    * @type int 
    * @jsonDate
    */
    private $createdDate;
    /**
    * @columnName COMPANY_IS_DELETED
    * @type int
    
    */
    private $isDeleted;
    
    
    
    
    /**
    * @columnName COMPANY_LANDLINE
    * @type string
    */
    private $email;
    
    private $associationDate;
    private $image;
    private $designation;
    private $isCurrentCompany;
    private $compUserId;
    private $isOwner;
    private $itemList;
    
//    private $location;
//
//    public function getLocation() {
//        return $this->location;
//    }
//
//    public function setLocation($location) {
//        $this->location = $location;
//    }

    



    public function getIsDeleted() {
        return $this->isDeleted;
    }

    public function setIsDeleted($isDeleted) {
        $this->isDeleted = $isDeleted;
    }
    
    public function getIsOwner() {
        return $this->isOwner;
    }

    public function setIsOwner($isOwner) {
        $this->isOwner = $isOwner;
    }

    public function getIsCurrentCompany() {
        return $this->isCurrentCompany;
    }

    public function setIsCurrentCompany($isCurrentCompany) {
        $this->isCurrentCompany = $isCurrentCompany;
    }

    public function getCompUserId() {
        return $this->compUserId;
    }

    public function setCompUserId($compUserId) {
        $this->compUserId = $compUserId;
    }

    public function getDesignation() {
        return $this->designation;
    }

    public function setDesignation($designation) {
        $this->designation = $designation;
    }

    public function getImage() {
        return $this->image;
    }

    public function setImage($image) {
        $this->image = $image;
    }

    public function getCompname() {
        return $this->compname;
    }

    public function setCompname($compname) {
        $this->compname = $compname;
    }

    public function getAddress() {
        return $this->address;
    }

    public function setAddress($address) {
        $this->address = $address;
    }

    public function getCreatedDate() {
        return $this->createdDate;
    }

    public function setCreatedDate($createdDate) {
        $this->createdDate = TUtilDate::getMilisecondsFromDate($createdDate);
    }

    public function getAssociationDate() {
        return $this->associationDate;
    }

    public function setAssociationDate($associationDate) {
        $this->associationDate = $associationDate;
    }

    public function getLandline2() {
        return $this->landline2;
    }

    public function setLandline2($landline2) {
        $this->landline2 = $landline2;
    }

    public function getWebsite() {
        return $this->website;
    }

    public function setWebsite($website) {
        $this->website = $website;
    }

    public function getId() {
        return $this->id;
    }

    public function setId($id) {
        $this->id = $id;
    }

    public function getBrief() {
        return $this->brief;
    }

    public function setBrief($brief) {
        $this->brief = $brief;
    }

    public function getLandline() {
        return $this->landline;
    }

    public function setLandline($landline) {
        $this->landline = $landline;
    }

    public function getEmail() {
        return $this->email;
    }

    public function setEmail($email) {
        $this->email = $email;
    }

    public function getCreator() {
        return $this->creator;
    }

    public function setCreator($creator) {
        $this->creator = $creator;
    }

    public function getItemList() {
        return $this->itemList;
    }

    public function setItemList($itemList) {
        $this->itemList = $itemList;
    }
    
    public function addItemToItemList(\Item $invItemDetails){
        if($this->itemList==null){
            $this->itemList=new SimpleList();
        }
        $this->itemList->add($invItemDetails);
    }   
    
    public function toJson() {
        $jsonMap = new Map();
        if ($this->getId() != "") {
            $jsonMap->put("id", $this->getId());
        }
        if ($this->getCompname() != "") {
            $jsonMap->put("compname", $this->getCompname());
        }
        if ($this->getBrief() != "") {
            $jsonMap->put("brief", $this->getBrief());
        }
        if ($this->getDesignation() != "") {
            $jsonMap->put("designation", $this->getDesignation());
        }
        if ($this->getLandline() != "") {
            $jsonMap->put("landline", $this->getLandline());
        }
        if ($this->getWebsite() != "") {
            $jsonMap->put("website", $this->getWebsite());
        }
        if ($this->getCreator() != "") {
            $jsonMap->put("creator", $this->getCreator());
        }
        if ($this->getLandline2() != "") {
            $jsonMap->put("landline2", $this->getLandline2());
        }
        if ($this->getAssociationDate() != "") {
            $jsonMap->put("associationDate", $this->getAssociationDate());
        }
        if ($this->getCreatedDate() != "") {
            $jsonMap->put("createdDate", $this->getCreatedDate());
        }
        if ($this->getAddress() != "") {
            $jsonMap->put("address", $this->getAddress());
        }
        if ($this->getImage() != "") {
            $jsonMap->put("image", $this->getImage());
        }
        if ($this->getIsCurrentCompany() != "") {
            $jsonMap->put("isCurrentCompany", $this->getIsCurrentCompany());
        }
        if ($this->getCompUserId() != "") {
            $jsonMap->put("compUserId", $this->getCompUserId());
        }
        if ($this->getIsOwner() != "") {
            $jsonMap->put("isOwner", $this->getIsOwner());
        }
        if ($this->getIsDeleted() != "") {
            $jsonMap->put("isDeleted", $this->getIsDeleted());
        }

        if ($this->getItemList() != null) {
            $jsonMap->put("itemList",$this->getItemList());}
//        $jsonMap->put("location",  $this->getLocation());
        return $jsonMap->toJson();
    }

}

?>
