Getting property values and associations

The get family

It is the same behavior for all types of property (standard properties, "has_many" with join table, "has_many", "has_many" with 'transient' option and 'belongs_to')

Various get methods


class User extends PorteRecord{

  public $meta_fields = array(
    'id'=>array('int'=>11),
    'username'=>array('size'=>50),
    'groups'=>array(
      'has_many'=>true,
    ),
    'gender'=>array(
      'belongs_to'=>true,
    ),
  );

}

$user = new User();
$user->load(1);
$user->getId();
$user->getUsername();
$user->getGroups();
$user->getGender();
    

Open Source Object Relational Mapping in PHP

Download Porte 0.2.1