ElggObject::update PHP Method

update() protected method

protected update ( )
    protected function update()
    {
        if (!parent::update()) {
            return false;
        }
        $dbprefix = elgg_get_config('dbprefix');
        $query = "\n\t\t\tUPDATE {$dbprefix}objects_entity\n\t\t\tSET title = :title,\n\t\t\t\tdescription = :description\n\t\t\tWHERE guid = :guid\n\t\t";
        $params = [':guid' => $this->guid, ':title' => (string) $this->title, ':description' => (string) $this->description];
        return $this->getDatabase()->updateData($query, false, $params) !== false;
    }

Usage Example

Beispiel #1
0
 /**
  * {@inheritdoc}
  */
 protected function update()
 {
     if (!parent::update()) {
         return false;
     }
     $fillup = false;
     if ($this->with_program && $this->hasSlotSpotsLeft()) {
         $fillup = true;
     } elseif (!$this->with_program && $this->hasEventSpotsLeft()) {
         $fillup = true;
     }
     if ($fillup) {
         while ($this->generateNewAttendee()) {
             continue;
         }
     }
     return true;
 }