Abstract Class Misago\Object

Generic object, to share methods between all misago's classes.

Example class:

class MyClass extends Misago\Object
{
  protected $id         = 1;
  private   $new_record = false;
  
  function new_record() {
    return $this->new_record;
  }
  
  function id() {
    return $this->id;
  }
  
  function id_set($id) {
    return $this->id = $id;
  }
} 

Getters and setters methods as attributes

You may define a list of non public properties that may be accessible on read, by using a public method named just like the property:

$o = new MyClass();
$o->new_record;         # => returns false 

You may also have a write setter, using a property_set method:

$o = new MyClass();
$o->id = 4;             # => returns 4 

Protected instance attributes

Methods

Public static methods

__constructStatic()

Public instance methods

to_array()

to_json()

to_s()

to_xml()

to_yaml()