|
Revision 49, 0.9 kB
(checked in by nperriault, 6 months ago)
|
Resolved the context "default" does not exist bug by removing calls to sfContext in the model.
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
class CompanyPerson extends BaseCompanyPerson |
|---|
| 8 |
{ |
|---|
| 9 |
|
|---|
| 10 |
public function save($con = null) |
|---|
| 11 |
{ |
|---|
| 12 |
$new = $this->isNew(); |
|---|
| 13 |
$modified = $this->isModified(); |
|---|
| 14 |
$save = parent::save($con); |
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 |
if ($new or $modified) |
|---|
| 18 |
{ |
|---|
| 19 |
$event = new Event(); |
|---|
| 20 |
$event->setSourceModel('sfGuardUser'); |
|---|
| 21 |
$event->setSourceSlug($this->getsfGuardUser()->getUsername()); |
|---|
| 22 |
$event->setSourceName($this->getsfGuardUser()->getDisplayName()); |
|---|
| 23 |
$event->setTargetModel('Company'); |
|---|
| 24 |
$event->setTargetSlug($this->getCompany()->getSlug()); |
|---|
| 25 |
$event->setTargetName($this->getCompany()->getName()); |
|---|
| 26 |
$event->setType('connection'); |
|---|
| 27 |
$event->setOccuredAt($this->getCreatedAt()); |
|---|
| 28 |
$event->save(); |
|---|
| 29 |
} |
|---|
| 30 |
|
|---|
| 31 |
return $save; |
|---|
| 32 |
} |
|---|
| 33 |
|
|---|
| 34 |
} |
|---|
| 35 |
|
|---|