Illuminate\Database\Eloquent\Model::usesTimestamps PHP Method

usesTimestamps() public method

Determine if the model uses timestamps.
public usesTimestamps ( ) : boolean
return boolean
    public function usesTimestamps()
    {
        return $this->timestamps;
    }

Usage Example

Example #1
0
 /**
  * Add the "updated at" column to an array of values.
  *
  * @param  array  $values
  * @return array
  */
 protected function addUpdatedAtColumn(array $values)
 {
     if (!$this->model->usesTimestamps()) {
         return $values;
     }
     $column = $this->model->getUpdatedAtColumn();
     return array_add($values, $column, $this->model->freshTimestampString());
 }
Model