root/trunk/lib/model/ApplicationDeveloper.php

Revision 49, 0.9 kB (checked in by nperriault, 8 months ago)

Resolved the context "default" does not exist bug by removing calls to sfContext in the model.

Line 
1 <?php
2 /**
3  * Subclass for representing a row from the 'applications_developer' table.
4  *
5  * @package lib.model
6  */
7 class ApplicationDeveloper extends BaseApplicationDeveloper
8 {
9
10   public function save($con = null)
11   {
12     $new = $this->isNew();
13     $modified = $this->isModified();
14     $save = parent::save($con);
15     
16     // Create "person recommended" event object
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('Application');
24       $event->setTargetSlug($this->getApplication()->getSlug());
25       $event->setTargetName($this->getApplication()->getName());
26       $event->setType('connection');
27       $event->save();
28     }
29     
30     return $save;
31   }
32
33 }
34
Note: See TracBrowser for help on using the browser.