WireData class

WireData is the base data-storage class used by many ProcessWire object types and most modules.

WireData is very much like its parent Wire class with the fundamental difference being that it is designed for runtime data storage. It provides this primarily through the built-in get() and set() methods for getting and setting named properties to WireData objects. The most common example of a WireData object is Page, the type used for all pages in ProcessWire.

Properties set to a WireData object can also be set or accessed directly, like $item->property or using array access like $item[$property]. If you foreach() a WireData object, the default behavior is to iterate all of the properties/values present within it.


Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the WireData class also inherits all the methods and properties of: Wire.

Show class?             Show args?        

Retrieval

NameReturnSummary 
WireData::and()
WireArrayTake the current item and append the given item(s), returning a new WireArray
WireData::data()
array WireData nullGet or set a low-level data value 
WireData::get($key)
mixed nullRetrieve the value for a previously set property, or retrieve an API variable 
WireData::getArray()
arrayReturns the full array of properties set to this object 
WireData::getDot(string $key)
null mixedGet a property via dot syntax: field.subfield.subfield 
WireData::getIterator()
ArrayObjectEnables the object data properties to be iterable as an array 
WireData::has(string $key)
boolDoes this object have the given property? 

Additional methods and properties

In addition to the methods and properties above, WireData also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.127

Twitter updates

  • New post: This week ProcessWire ProMailer has been released, plus we’ve got a nice upgrade in our community support forum, and more— More
    15 March 2019
  • New post: This week we look at the latest version of ProcessWire, 3.0.127 with nearly 30 new commits resolving dozens of older issue reports and a couple useful new features— More
    1 March 2019
  • New post: This week we take a look at what’s in ProcessWire 3.0.126 which focuses largely on resolving issue reports, but also includes a handy new Page if() method— More
    15 February 2019

Latest news

  • ProcessWire Weekly #253
    In the 253rd issue of ProcessWire Weekly we'll introduce the ProMailer Pro module, cover the upgrade made to our support forum software, check out Sanitizer Transliterate, and pick a new site of the week. Read on!
    Weekly.pw / 16 March 2019
  • ProcessWire ProMailer now available
    This week ProcessWire ProMailer has been released, plus we’ve got a nice upgrade in our community support forum, and more.
    Blog / 15 March 2019
  • Subscribe to weekly ProcessWire news

“We chose ProcessWire because of its excellent architecture, modular extensibility and the internal API. The CMS offers the necessary flexibility and performance for such a complex website like superbude.de. ProcessWire offers options that are only available for larger systems, such as Drupal, and allows a much slimmer development process.” —xport communication GmbH