classes/Persistence.php
private static function persistenceLoadDefault($pk, $table, $options){
    if ( $data = SQL::single("SELECT * FROM $table WHERE {$options['key']}=? LIMIT 1",[$pk]) ){
       $obj = new static;
       foreach ((array)$data as $key => $value) {
         $obj->$key = $value;
       }
       if (is_callable(($c=get_called_class())."::trigger")) $c::trigger("load", $obj, $table, $options['key']);
       return $obj;
     } else {
       return null;
     }
  }
private static function persistenceLoadDefault($pk, $table, $options){
    if ( $data = SQL::single("SELECT * FROM $table WHERE {$options['key']}=? LIMIT 1",[$pk]) ){
       $obj = new static;
       foreach ((array)$data as $key => $value) {
         $obj->$key = $value;
       }
       if (is_callable(($c=get_called_class())."::trigger")) $c::trigger("load", $obj, $table, $options['key']);
       return $obj;
     } else {
       return null;
     }
  }
private static function persistenceLoadDefault ( $ pk , $ table , $ options ) { if ( $ data = SQL :: single ( "SELECT * FROM $table WHERE {$options['key']}=? LIMIT 1" , [ $ pk ] ) ) { $ obj = new static ; foreach ( ( array ) $ data as $ key => $ value ) { $ obj -> $ key = $ value ; } if ( is_callable ( ( $ c = get_called_class ( ) ) . "::trigger" ) ) $ c :: trigger ( "load" , $ obj , $ table , $ options [ 'key' ] ) ; return $ obj ; } else { return null ; } }
Private Standard Load Method
Private Standard Load Method