public function getAll(...$args)
    {
        $pkey = $this->getPrimaryKey();

        if (count($pkey) === 1)
        {
            reset($pkey);
            $pkey_as_index = key($pkey);
        }
        else
            $pkey_as_index = false;

        $list = array();
        $records = $this->fetchAll($args);
        foreach ($records as $record)
        {
            $obj = new $this->model_class;
            $obj->assignRecord($record, $this->db);

            if ($pkey_as_index)
                $list[$obj->getField($pkey_as_index)] = $obj;
            else
                $list[] = $obj;
        }
        return $list;
    }
public function getAll(...$args)
    {
        $pkey = $this->getPrimaryKey();

        if (count($pkey) === 1)
        {
            reset($pkey);
            $pkey_as_index = key($pkey);
        }
        else
            $pkey_as_index = false;

        $list = array();
        $records = $this->fetchAll($args);
        foreach ($records as $record)
        {
            $obj = new $this->model_class;
            $obj->assignRecord($record, $this->db);

            if ($pkey_as_index)
                $list[$obj->getField($pkey_as_index)] = $obj;
            else
                $list[] = $obj;
        }
        return $list;
    }
public function getAll ( ... $ args ) { $ pkey = $ this -> getPrimaryKey ( ) ; if ( count ( $ pkey ) === 1 ) { reset ( $ pkey ) ; $ pkey_as_index = key ( $ pkey ) ; } else $ pkey_as_index = false ; $ list = array ( ) ; $ records = $ this -> fetchAll ( $ args ) ; foreach ( $ records as $ record ) { $ obj = new $ this -> model_class ; $ obj -> assignRecord ( $ record , $ this -> db ) ; if ( $ pkey_as_index ) $ list [ $ obj -> getField ( $ pkey_as_index ) ] = $ obj ; else $ list [ ] = $ obj ; } return $ list ; }
Retrieve a set of records, create object from them and return the resulting list.
@param $args The provided arguments for the select query.
@return array The retrieved DAO objects. If the primary key is a single field, the indices correspond to the primary key
@see Wedeto\DB\DAO::select
Retrieve a set of records create object from them and return the resulting list .