|
Revision 2, 0.9 kB
(checked in by nperriault, 8 months ago)
|
First commit of the extracted code from production, I hope no passwd has been forgotten :-)
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
class ApplicationCompany extends BaseApplicationCompany |
|---|
| 8 |
{ |
|---|
| 9 |
|
|---|
| 10 |
public function save($con = null) |
|---|
| 11 |
{ |
|---|
| 12 |
$new = $this->isNew(); |
|---|
| 13 |
$modified = $this->isModified(); |
|---|
| 14 |
$affectedRows = parent::save($con); |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
if ($new or $modified) |
|---|
| 18 |
{ |
|---|
| 19 |
$event = new Event(); |
|---|
| 20 |
$event->setSourceModel('Company'); |
|---|
| 21 |
$event->setSourceSlug($this->getCompany()->getSlug()); |
|---|
| 22 |
$event->setSourceName($this->getCompany()->getName()); |
|---|
| 23 |
$event->setTargetModel('Application'); |
|---|
| 24 |
$event->setTargetSlug($this->getApplication()->getSlug()); |
|---|
| 25 |
$event->setTargetName($this->getApplication()->getName()); |
|---|
| 26 |
$event->setType('connection'); |
|---|
| 27 |
$event->save(); |
|---|
| 28 |
} |
|---|
| 29 |
|
|---|
| 30 |
return $affectedRows; |
|---|
| 31 |
} |
|---|
| 32 |
|
|---|
| 33 |
} |
|---|
| 34 |
|
|---|