2 namespace Company\Entity;
4 use Doctrine\ORM\Mapping as ORM;
11 * @ORM\HasLifecycleCallbacks
12 * @ORM\Table(name="company")
18 * Can archive records.
22 * Pull Synchronization Strategy for this table.
24 const PULL_SYNCH_STRATEGY = false;
26 * Push Synchronization Strategy for this table.
28 const PUSH_SYNCH_STRATEGY = false;
31 * Valid dealer types values.
33 const DEALERTYPE_DEALER = 'Dealer';
34 const DEALERTYPE_TRADER = 'Trader';
35 const DEALERTYPE_TRADE_CENTER = 'Trade Center';
38 * Valid client types values.
40 const CLIENTTYPE_BUYER = 'Buyer';
41 const CLIENTTYPE_SELLER = 'Buyer & Seller';
44 * Valid company types values.
46 const COMPANYTYPE_LTD = 'Limited';
47 const COMPANYTYPE_PTY_LTD = 'PTY Limited';
48 const COMPANYTYPE_CC = 'Closed Corporation';
49 const COMPANYTYPE_SOLE_PROP = 'Sole Proprietor';
53 * @ORM\Column(type="integer");
54 * @ORM\GeneratedValue(strategy="AUTO")
59 * @ORM\Column(type="string", length=100)
64 * @ORM\Column(type="string", length=100, nullable=true, name="business_name")
66 protected $businessName;
69 * @ORM\ManyToOne(targetEntity="\Location\Entity\Region")
70 * @ORM\JoinColumn(nullable=false, name="lib_region_id")
75 * @ORM\ManyToOne(targetEntity="\Location\Entity\Town")
76 * @ORM\JoinColumn(nullable=false, name="lib_town_id")
81 * @ORM\Column(type="string", length=10, name="postal_code")
83 protected $postalCode;
86 * @ORM\Column(type="string", length=75)
91 * @ORM\ManyToOne(targetEntity="\Location\Entity\Town")
92 * @ORM\JoinColumn(nullable=true, name="billing_lib_town_id")
94 protected $billingCity;
97 * @ORM\Column(type="string", length=10, nullable=true, name="billing_postal_code")
99 protected $billingPostalCode;
102 * @ORM\Column(type="string", length=75, nullable=true, name="billing_street")
104 protected $billingStreet;
107 * @ORM\ManyToOne(targetEntity="\Location\Entity\Town")
108 * @ORM\JoinColumn(nullable=false, nullable=true, name="auction_lib_town_id")
110 protected $auctionCity;
113 * @ORM\Column(type="string", length=10, nullable=true, name="auction_postal_code")
115 protected $auctionPostalCode;
118 * @ORM\Column(type="string", length=75, nullable=true, name="auction_street")
120 protected $auctionStreet;
123 * @ORM\Column(type="string", length=25, name="dealer_type")
125 protected $dealerType = 'Trader';
128 * @ORM\Column(type="string", length=25, name="client_type")
130 protected $clientType = 'Seller';
133 * @ORM\Column(type="string", length=100, nullable=true, name="company_registration_number")
135 protected $companyRegistrationNumber;
138 * @ORM\Column(type="string", nullable=true, length=20, name="vat_number")
140 protected $vatNumber;
143 * @ORM\Column(type="string", nullable=true, length=50, name="turmi_no")
145 protected $turmiNumber;
148 * @ORM\Column(type="string", nullable=true, length=50, name="dealer_stock_number")
150 protected $dealerStockNumber;
153 * @ORM\ManyToOne(targetEntity="Company")
154 * @ORM\JoinColumn(nullable=true, name="trade_center_dealer_id")
156 protected $tradeCenter;
159 * @ORM\Column(type="boolean", name="trade_exchange_link");
161 protected $tradeExchangeLink = false;
164 * @ORM\ManyToOne(targetEntity="Group")
165 * @ORM\JoinColumn(name="company_group_id")
170 * @ORM\ManyToOne(targetEntity="GroupDivision")
171 * @ORM\JoinColumn(nullable=true, name="company_group_division_id")
173 protected $groupDivision;
176 * @ORM\ManyToOne(targetEntity="\Config\Entity\RegionalManager")
177 * @ORM\JoinColumn(nullable=true, name="regional_manager_id")
179 protected $regionalManager;
182 * @ORM\Column(type="string", nullable=true, length=25, name="company_type")
184 protected $companyType;
187 * @ORM\Column(type="string", nullable=true, length=25, name="company_turnover")
192 * @ORM\OneToOne(targetEntity="\Person\Entity\Contact")
193 * @ORM\JoinColumn(nullable=true, name="lib_contact_id")
198 * @ORM\OneToOne(targetEntity="\Person\Entity\Contact")
199 * @ORM\JoinColumn(nullable=true, name="billing_lib_contact_id")
201 protected $billingContact;
204 * @ORM\ManyToOne(targetEntity="FoundMethod")
205 * @ORM\JoinColumn(nullable=true, name="company_found_method_id")
207 protected $foundMethod;
210 * @ORM\ManyToOne(targetEntity="FoundMethodDetail")
211 * @ORM\JoinColumn(nullable=true, name="company_found_method_detail_id")
213 protected $foundMethodDetail;
216 * @ORM\OneToOne(targetEntity="\Utility\Entity\Image")
217 * @ORM\JoinColumn(nullable=true, name="lib_photo_id")
219 protected $dealershipPhoto;
222 * @ORM\Column(type="boolean", name="price_guide");
224 protected $priceGuide = false;
227 * @ORM\Column(type="boolean", name="club_invite");
229 protected $clubInvite = false;
232 * @ORM\ManyToOne(targetEntity="\Utility\Entity\Document")
233 * @ORM\JoinColumn(nullable=true, name="stock_cert_lib_document_id")
235 private $docStockCertificate;
238 * @ORM\ManyToOne(targetEntity="\Utility\Entity\Document")
239 * @ORM\JoinColumn(nullable=true, name="address_proof_lib_document_id")
241 private $docAddressProof;
244 * @ORM\ManyToOne(targetEntity="\Utility\Entity\Document")
245 * @ORM\JoinColumn(nullable=true, name="copy_of_id_lib_document_id")
247 private $docCopyOfId;
250 * @ORM\ManyToOne(targetEntity="\Utility\Entity\Document")
251 * @ORM\JoinColumn(nullable=true, name="copy_of_director_id_lib_document_id")
253 private $docCopyOfDirectorId;
256 * @ORM\ManyToOne(targetEntity="\Utility\Entity\Document")
257 * @ORM\JoinColumn(nullable=true, name="company_reg_lib_document_id")
259 private $docCompanyRegistration;
262 * @ORM\Column(nullable=true, type="string", length=64, name="automate_file")
264 protected $automateFile;
267 * @ORM\Column(nullable=true, type="string", length=20, name="automate_dealer_code")
269 protected $automateDealerCode;
272 * @ORM\Column(nullable=true, type="string", length=64, name="autoline_file")
274 protected $autolineFile;
277 * @ORM\Column(nullable=true, type="string", length=20, name="autoline_dealer_code")
279 protected $autolineDealerCode;
282 * @ORM\Column(nullable=true, type="string", length=64, name="amhgroup_file")
284 protected $amhgroupFile;
287 * @ORM\Column(nullable=true, type="string", length=20, name="amhgroup_dealer_code")
289 protected $amhgroupDealerCode;
293 * @ORM\OneToMany(targetEntity="\User\Entity\Profile", mappedBy="company", fetch="EXTRA_LAZY")
298 * @ORM\OneToMany(targetEntity="CompanyRetail", mappedBy="company", fetch="EXTRA_LAZY")
303 * @ORM\OneToMany(targetEntity="CompanyOwner", mappedBy="company", cascade={"all"}, fetch="EXTRA_LAZY")
308 * @ORM\Column(type="string", length=10, name="status")
310 protected $jobState = 'New';
313 * @ORM\Column(type="string", nullable=true, length=250, name="status_reason")
315 protected $statusReason;
318 * @ORM\Column(type="boolean", name="public_centre");
320 protected $publicCentre = false;
323 * @ORM\Column(type="datetime");
328 * @ORM\Column(type="datetime", nullable=true);
333 * @ORM\Column(type="boolean");
335 protected $archived = false;
340 * Initialize collections.
342 public function __construct()
344 $this->profiles = new \Doctrine\Common\Collections\ArrayCollection();
345 $this->retailers = new \Doctrine\Common\Collections\ArrayCollection();
346 $this->owners = new \Doctrine\Common\Collections\ArrayCollection();
351 * Magic getter to expose protected properties.
352 * @param string $property
355 public function __get($property)
357 return $this->$property;
361 * Magic setter to save protected properties.
362 * @param string $property
363 * @param mixed $value
365 public function __set($property, $value)
367 $this->$property = $value;
373 public function setCreateTime()
375 $this->created = new \DateTime("now");
381 public function setUpdateTime()
383 $this->updated = new \DateTime("now");
387 * Convert the object to an array.
388 * @param array $expand
389 * @param array $intersect
390 * @param boolean $showIdentifiers
391 * @param integer $expandAll
394 public function toArray(
395 array $expand = array(), array $intersect = array(),
396 $showIdentifiers = false, $expandAll = 0
399 $intersect = array_flip($intersect);
400 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
401 $includeAll = empty($intersect);
402 $recExpand = $expand;
403 foreach ($recExpand as $i => $val)
405 if ('company' == $val || 'tradeCenter' == $val)
407 unset($recExpand[$i]);
411 ($includeAll || isset($intersect['id']))
412 && $data['id'] = $this->id;
413 ($includeAll || isset($intersect['name']))
414 && $data['name'] = $this->name;
415 ($includeAll || isset($intersect['businessName']))
416 && $data['businessName'] = $this->businessName;
418 ($includeAll || isset($intersect['region']))
419 && $data['region'] = (in_array('region', $expand) || $expandAll || $showIdentifiers)
420 && !is_null($this->region)
421 ? (!$showIdentifiers || in_array('region', $expand) ? $this->region->toArray(
422 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
423 ) : $this->region->id)
425 ($includeAll || isset($intersect['city']))
426 && $data['city'] = (in_array('city', $expand) || $expandAll || $showIdentifiers)
427 && !is_null($this->city)
428 ? (!$showIdentifiers || in_array('city', $expand) ? $this->city->toArray(
429 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
434 ($includeAll || isset($intersect['postalCode']))
435 && $data['postalCode'] = $this->postalCode;
436 ($includeAll || isset($intersect['street']))
437 && $data['street'] = $this->street;
439 ($includeAll || isset($intersect['billingCity']))
440 && $data['billingCity'] = (in_array('billingCity', $expand) || $expandAll || $showIdentifiers)
441 && !is_null($this->billingCity)
442 ? (!$showIdentifiers || in_array('billingCity', $expand) ? $this->billingCity->toArray(
443 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
444 ) : $this->billingCity->id)
446 ($includeAll || isset($intersect['billingPostalCode']))
447 && $data['billingPostalCode'] = $this->billingPostalCode;
448 ($includeAll || isset($intersect['billingStreet']))
449 && $data['billingStreet'] = $this->billingStreet;
450 ($includeAll || isset($intersect['auctionCity']))
451 && $data['auctionCity'] = (in_array('auctionCity', $expand) || $expandAll || $showIdentifiers)
452 && !is_null($this->auctionCity)
453 ? (!$showIdentifiers || in_array('auctionCity', $expand) ? $this->auctionCity->toArray(
454 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
455 ) : $this->auctionCity->id)
457 ($includeAll || isset($intersect['auctionPostalCode']))
458 && $data['auctionPostalCode'] = $this->auctionPostalCode;
459 ($includeAll || isset($intersect['auctionStreet']))
460 && $data['auctionStreet'] = $this->auctionStreet;
462 ($includeAll || isset($intersect['dealerType']))
463 && $data['dealerType'] = $this->dealerType;
464 ($includeAll || isset($intersect['clientType']))
465 && $data['clientType'] = $this->clientType;
466 ($includeAll || isset($intersect['companyRegistrationNumber']))
467 && $data['companyRegistrationNumber'] = $this->companyRegistrationNumber;
468 ($includeAll || isset($intersect['vatNumber']))
469 && $data['vatNumber'] = $this->vatNumber;
470 ($includeAll || isset($intersect['turmiNumber']))
471 && $data['turmiNumber'] = $this->turmiNumber;
472 ($includeAll || isset($intersect['dealerStockNumber']))
473 && $data['dealerStockNumber'] = $this->dealerStockNumber;
474 ($includeAll || isset($intersect['tradeCenter']))
475 && $data['tradeCenter'] = (in_array('tradeCenter', $expand) || $expandAll || $showIdentifiers)
476 && !is_null($this->tradeCenter)
477 ? (!$showIdentifiers || in_array('tradeCenter', $expand)
478 ? $this->tradeCenter->toArray(
479 array(), array('id', 'name'), $showIdentifiers, 0
481 : $this->tradeCenter->id)
483 ($includeAll || isset($intersect['tradeExchangeLink']))
484 && $data['tradeExchangeLink'] = $this->tradeExchangeLink;
485 ($includeAll || isset($intersect['group']))
486 && $data['group'] = (in_array('group', $expand) || $expandAll || $showIdentifiers)
487 && !is_null($this->group)
488 ? (!$showIdentifiers || in_array('group', $expand) ? $this->group->toArray(
489 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
490 ) : $this->group->id)
492 ($includeAll || isset($intersect['groupDivision']))
493 && $data['groupDivision'] = (in_array('groupDivision', $expand) || $expandAll || $showIdentifiers)
494 && !is_null($this->groupDivision)
495 ? (!$showIdentifiers || in_array('groupDivision', $expand) ? $this->groupDivision->toArray(
496 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
497 ) : $this->groupDivision->id)
499 ($includeAll || isset($intersect['regionalManager']))
500 && $data['regionalManager'] = (in_array('regionalManager', $expand) || $expandAll || $showIdentifiers)
501 && !is_null($this->regionalManager)
502 ? (!$showIdentifiers || in_array('regionalManager', $expand) ? $this->regionalManager->toArray(
503 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
504 ) : $this->regionalManager->id)
506 ($includeAll || isset($intersect['companyType']))
507 && $data['companyType'] = $this->companyType;
508 ($includeAll || isset($intersect['turnover']))
509 && $data['turnover'] = $this->turnover;
510 ($includeAll || isset($intersect['contact']))
511 && $data['contact'] = (in_array('contact', $expand) || $expandAll || $showIdentifiers)
512 && !is_null($this->contact)
513 ? (!$showIdentifiers || in_array('contact', $expand) ? $this->contact->toArray(
514 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
515 ) : $this->contact->id)
517 ($includeAll || isset($intersect['billingContact']))
518 && $data['billingContact'] = (in_array('billingContact', $expand) || $expandAll || $showIdentifiers)
519 && !is_null($this->billingContact)
520 ? (!$showIdentifiers || in_array('billingContact', $expand) ? $this->billingContact->toArray(
521 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
522 ) : $this->billingContact->id)
524 ($includeAll || isset($intersect['foundMethod']))
525 && $data['foundMethod'] = (in_array('foundMethod', $expand) || $expandAll || $showIdentifiers)
526 && !is_null($this->foundMethod)
527 ? (!$showIdentifiers || in_array('foundMethod', $expand) ? $this->foundMethod->toArray(
528 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
529 ) : $this->foundMethod->id)
531 ($includeAll || isset($intersect['foundMethodDetail']))
532 && $data['foundMethodDetail'] = (in_array('foundMethodDetail', $expand) || $expandAll || $showIdentifiers)
533 && !is_null($this->foundMethodDetail)
534 ? (!$showIdentifiers || in_array('foundMethodDetail', $expand) ? $this->foundMethodDetail->toArray(
535 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
536 ) : $this->foundMethodDetail->id)
538 ($includeAll || isset($intersect['dealershipPhoto']))
539 && $data['dealershipPhoto'] = (in_array('dealershipPhoto', $expand) || $expandAll || $showIdentifiers)
540 && !is_null($this->dealershipPhoto)
541 ? (!$showIdentifiers || in_array('dealershipPhoto', $expand) ? $this->dealershipPhoto->toArray(
542 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
543 ) : $this->dealershipPhoto->id)
545 ($includeAll || isset($intersect['priceGuide']))
546 && $data['priceGuide'] = $this->priceGuide;
549 ($includeAll || isset($intersect['publicCentre']))
550 && $data['publicCentre'] = $this->publicCentre;
553 ($includeAll || isset($intersect['clubInvite']))
554 && $data['clubInvite'] = $this->clubInvite;
556 ($includeAll || isset($intersect['docStockCertificate']))
557 && $data['docStockCertificate'] = (in_array('docStockCertificate', $expand) || $expandAll || $showIdentifiers)
558 && !is_null($this->docStockCertificate)
559 ? (!$showIdentifiers || in_array('docStockCertificate', $expand) ? $this->docStockCertificate->toArray(
560 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
561 ) : $this->docStockCertificate->id)
563 ($includeAll || isset($intersect['docAddressProof']))
564 && $data['docAddressProof'] = (in_array('docAddressProof', $expand) || $expandAll || $showIdentifiers)
565 && !is_null($this->docAddressProof)
566 ? (!$showIdentifiers || in_array('docAddressProof', $expand) ? $this->docAddressProof->toArray(
567 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
568 ) : $this->docAddressProof->id)
570 ($includeAll || isset($intersect['docCopyOfId']))
571 && $data['docCopyOfId'] = (in_array('docCopyOfId', $expand) || $expandAll || $showIdentifiers)
572 && !is_null($this->docCopyOfId)
573 ? (!$showIdentifiers || in_array('docCopyOfId', $expand) ? $this->docCopyOfId->toArray(
574 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
575 ) : $this->docCopyOfId->id)
577 ($includeAll || isset($intersect['docCopyOfDirectorId']))
578 && $data['docCopyOfDirectorId'] = (in_array('docCopyOfDirectorId', $expand) || $expandAll || $showIdentifiers)
579 && !is_null($this->docCopyOfDirectorId)
580 ? (!$showIdentifiers || in_array('docCopyOfDirectorId', $expand) ? $this->docCopyOfDirectorId->toArray(
581 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
582 ) : $this->docCopyOfDirectorId->id)
584 ($includeAll || isset($intersect['docCompanyRegistration']))
585 && $data['docCompanyRegistration'] = (in_array('docCompanyRegistration', $expand) || $expandAll || $showIdentifiers)
586 && !is_null($this->docCompanyRegistration)
587 ? (!$showIdentifiers || in_array('docCompanyRegistration', $expand) ? $this->docCompanyRegistration->toArray(
588 $expand, $intersect, $showIdentifiers, ($expandAll - 1)
589 ) : $this->docCompanyRegistration->id)
592 ($includeAll || isset($intersect['automateFile']))
593 && $data['automateFile'] = $this->automateFile;
594 ($includeAll || isset($intersect['automateDealerCode']))
595 && $data['automateDealerCode'] = $this->automateDealerCode;
597 ($includeAll || isset($intersect['autolineFile']))
598 && $data['autolineFile'] = $this->autolineFile;
599 ($includeAll || isset($intersect['autolineDealerCode']))
600 && $data['autolineDealerCode'] = $this->autolineDealerCode;
602 ($includeAll || isset($intersect['amhgroupFile']))
603 && $data['amhgroupFile'] = $this->amhgroupFile;
604 ($includeAll || isset($intersect['amhgroupDealerCode']))
605 && $data['amhgroupDealerCode'] = $this->amhgroupDealerCode;
607 ($includeAll || isset($intersect['jobState']))
608 && $data['jobState'] = $this->jobState;
609 ($includeAll || isset($intersect['statusReason']))
610 && $data['statusReason'] = $this->statusReason;
611 ($includeAll || isset($intersect['created']))
612 && $data['created'] = !is_null($this->created)
613 ? $this->created->format($dateTimeFormat)
615 ($includeAll || isset($intersect['updated']))
616 && $data['updated'] = !is_null($this->updated)
617 ? $this->updated->format($dateTimeFormat)
623 * Internal utility to change owners collection into array.
624 * @param boolean $showIdentifiers
627 protected function ownersToArray($showIdentifiers = false)
630 $iterator = $this->owners->getIterator();
631 foreach ($iterator as $owner)
633 $data[] = $showIdentifiers
634 ? array('id' => $owner->id)
641 * Populate from an array.
644 public function fromArray($data = array())
647 && $this->id = $data['id'];
648 if (isset($data['name']))
650 $this->name = $data['name'];
652 #-> Update de-normalized auction data.
653 $em = \Utility\Registry::getEntityManager();
657 'UPDATE \Auction\Entity\Auction a '
658 . "SET a.auctionCompanyName = :name "
659 . 'WHERE a.jobState = :jobState '
660 . ' AND a.auctionCompanyId = :id'
662 ->setParameter('jobState', 'Active')
663 ->setParameter('id', $this->id)
664 ->setParameter('name', $this->name)
668 isset($data['businessName'])
669 && $this->businessName = $data['businessName'];
670 isset($data['region'])
671 && $this->region = $data['region'];
673 && $this->city = $data['city'];
676 isset($data['publicCentre'])
677 && $this->publicCentre = $data['publicCentre'];
679 isset($data['postalCode'])
680 && $this->postalCode = $data['postalCode'];
681 isset($data['street'])
682 && $this->street = $data['street'];
683 isset($data['billingCity'])
684 && $this->billingCity = $data['billingCity'];
685 isset($data['billingPostalCode'])
686 && $this->billingPostalCode = $data['billingPostalCode'];
687 isset($data['billingStreet'])
688 && $this->billingStreet = $data['billingStreet'];
689 isset($data['auctionCity'])
690 && $this->auctionCity = $data['auctionCity'];
691 isset($data['auctionPostalCode'])
692 && $this->auctionPostalCode = $data['auctionPostalCode'];
693 isset($data['auctionStreet'])
694 && $this->auctionStreet = $data['auctionStreet'];
695 isset($data['dealerType'])
696 && $this->dealerType = $data['dealerType'];
697 isset($data['clientType'])
698 && $this->clientType = $data['clientType'];
699 isset($data['companyRegistrationNumber'])
700 && $this->companyRegistrationNumber = $data['companyRegistrationNumber'];
701 isset($data['vatNumber'])
702 && $this->vatNumber = $data['vatNumber'];
703 isset($data['turmiNumber'])
704 && $this->turmiNumber = $data['turmiNumber'];
705 isset($data['dealerStockNumber'])
706 && $this->dealerStockNumber = $data['dealerStockNumber'];
707 key_exists('tradeCenter', $data)
708 && $this->tradeCenter = $data['tradeCenter'];
709 isset($data['tradeExchangeLink'])
710 && $this->tradeExchangeLink = $data['tradeExchangeLink'];
711 isset($data['group'])
712 && $this->group = $data['group'];
713 isset($data['groupDivision'])
714 && $this->groupDivision = $data['groupDivision'];
715 isset($data['regionalManager'])
716 && $this->regionalManager = $data['regionalManager'];
717 isset($data['companyType'])
718 && $this->companyType = $data['companyType'];
719 isset($data['turnover'])
720 && $this->turnover = $data['turnover'];
721 isset($data['contact'])
722 && $this->contact = $data['contact'];
723 isset($data['foundMethod'])
724 && $this->foundMethod = $data['foundMethod'];
725 isset($data['foundMethodDetail'])
726 && $this->foundMethodDetail = $data['foundMethodDetail'];
727 isset($data['dealershipPhoto'])
728 && $this->dealershipPhoto = $data['dealershipPhoto'];
729 isset($data['priceGuide'])
730 && $this->priceGuide = $data['priceGuide'];
733 isset($data['publicCentre'])
734 && $this->publicCentre = $data['publicCentre'];
737 isset($data['clubInvite'])
738 && $this->clubInvite = $data['clubInvite'];
739 isset($data['statusReason'])
740 && $this->statusReason = $data['statusReason'];
742 isset($data['docCopyOfId'])
743 && $this->docCopyOfId = $data['docCopyOfId'];
744 isset($data['docCopyOfDirectorId'])
745 && $this->docCopyOfDirectorId = $data['docCopyOfDirectorId'];
746 isset($data['docCompanyRegistration'])
747 && $this->docCompanyRegistration = $data['docCompanyRegistration'];
748 isset($data['docStockCertificate'])
749 && $this->docStockCertificate = $data['docStockCertificate'];
750 isset($data['docAddressProof'])
751 && $this->docAddressProof = $data['docAddressProof'];
753 isset($data['automateFile'])
754 && $this->automateFile = $data['automateFile'];
755 isset($data['automateDealerCode'])
756 && $this->automateDealerCode = $data['automateDealerCode'];
758 isset($data['autolineFile'])
759 && $this->autolineFile = $data['autolineFile'];
760 isset($data['autolineDealerCode'])
761 && $this->autolineDealerCode = $data['autolineDealerCode'];
763 isset($data['amhgroupFile'])
764 && $this->amhgroupFile = $data['amhgroupFile'];
765 isset($data['amhgroupDealerCode'])
766 && $this->amhgroupDealerCode = $data['amhgroupDealerCode'];
769 if (isset($data['owners']))
771 $em = \Utility\Registry::getEntityManager();
772 $iterator = $this->owners->getIterator();
773 foreach ($iterator as $ownr)
777 foreach ($data['owners'] as $ownr)
779 $companyOwnr = new \Company\Entity\CompanyOwner();
780 $companyOwnr->firstName = $ownr['firstName'];
781 $companyOwnr->familyName = $ownr['familyName'];
782 $companyOwnr->idNumber = $ownr['idNumber'];
783 $companyOwnr->company = $this;
784 $this->owners->add($companyOwnr);