コード例 #1
0
ファイル: JobeetJob.class.php プロジェクト: rrhartjr/jobeet
 public function delete(Doctrine_Connection $conn = null)
 {
     $index = JobeetJobTable::getLuceneIndex();
     foreach ($index->find('pk:' . $this->getId()) as $hit) {
         $index->delete($hit->id);
     }
     return parent::delete($conn);
 }
コード例 #2
0
 public function save(Doctrine_Connection $conn = null)
 {
     if ($this->isNew() && !$this->getExpiresAt()) {
         $now = $this->getCreatedAt() ? $this->getDateTimeObject('created_at')->format('U') : time();
         $this->setExpiresAt(date('Y-m-d H:i:s', $now + 86400 * sfConfig::get('app_active_days')));
     }
     return parent::save($conn);
 }
コード例 #3
0
ファイル: JobeetJob.class.php プロジェクト: nikoTchan/Jobeet
 public function save(Doctrine_Connection $conn = null)
 {
     if ($this->isNew() && !$this->getExpiresAt()) {
         $now = $this->getCreatedAt() ? strtotime($this->getCreatedAt()) : time();
         $this->setExpiresAt(date('Y-m-d h:i:s', $now + 86400 * sfConfig::get('app_active_days')));
     }
     return parent::save($conn);
 }
コード例 #4
0
 public function save(Doctrine_Connection $conn = null)
 {
     //Si el objeto se está por serialzar por primera vez, y no se especificó la fecha de caducidad...
     if ($this->isNew() && !$this->getExpiresAt()) {
         //Si existe la fecha de creación, la utilizamos. De lo contrario utilizamos el tiempo actual
         $timeNow = $this->getCreatedAt() ? strtotime('', $this->getCreatedAt()) : time();
         $this->setExpiresAt(date('Y-m-d h:i:s', $timeNow + 60 * 60 * 24 * sfConfig::get('app_active_days')));
         //( segundos * minutos * horas ) * dias
     }
     return parent::save($conn);
 }
コード例 #5
0
ファイル: JobeetJob.php プロジェクト: hira-yahoo/Jobeet4
 public function save(PropelPDO $con = null)
 {
     if ($this->isNew() && !$this->getExpiresAt()) {
         $now = $this->getCreatedAt() ? $this->getCreatedAt('U') : time();
         $this->setExpiresAt($now + 86400 * sfConfig::get('app_active_days'));
     }
     if (!$this->getToken()) {
         $this->setToken(sha1($this->getEmail() . rand(11111, 99999)));
     }
     return parent::save($con);
 }
コード例 #6
0
 /**
  * Initializes internal state of JobeetJob object.
  * @see        parent::__construct()
  */
 public function __construct()
 {
     // Make sure that parent constructor is always invoked, since that
     // is where any default values for this object are set.
     parent::__construct();
 }
コード例 #7
0
ファイル: BaseJobeetJob.php プロジェクト: rdi0r/dreamrc
 /**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     JobeetJobPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new JobeetJobPeer();
     }
     return self::$peer;
 }