PagesEditor::editor method

Update page modified/created/published time to now (or given time)

Usage

// basic usage
$bool = $pages->editor->touch($pages);

// usage with all arguments
$bool = $pages->editor->touch($pages, $options = null, string $type = 'modified');

Arguments

NameType(s)Description
$pagesPage PageArray array

May be Page, PageArray or array of page IDs (integers)

$options (optional)null int string array

Omit (null) to update to now, or unix timestamp or strtotime() recognized time string, or if you do not need this argument, you may optionally substitute the $type argument here, or in 3.0.183+ you can also specify array of options here instead:

  • time (string|int|null): Unix timestamp or strtotime() recognized string to use, omit for use current time Default:null
  • type (string): One of 'modified', 'created', 'published' Default:'modified'
  • user (bool|User): True to also update modified/created user to current user, or specify User object to use Default:false
$type (optional)string

Date type to update, one of 'modified', 'created' or 'published' Default:'modified' Added 3.0.147 Skip this argument if using options array for previous argument or if using the default type 'modified'.

Return value

bool

True on success, false on fail

Exceptions

Method can throw exceptions on error:

  • WireException or \PDOException - if given invalid format for $modified argument or failed database query


$pages->editor methods and properties

API reference based on ProcessWire core version 3.0.252