public function tryLoadAny(Model $m, $table = null)
    {
        if (!isset($table)) {
            $table = $m->table;
        }

        if (!$this->data[$table]) {
            return false; // no records at all in table
        }

        reset($this->data[$table]);
        $key = key($this->data[$table]);

        $row = $this->load($m, $key, $table);
        $m->id = $key;

        return $row;
    }
public function tryLoadAny(Model $m, $table = null)
    {
        if (!isset($table)) {
            $table = $m->table;
        }

        if (!$this->data[$table]) {
            return false; // no records at all in table
        }

        reset($this->data[$table]);
        $key = key($this->data[$table]);

        $row = $this->load($m, $key, $table);
        $m->id = $key;

        return $row;
    }
public function tryLoadAny ( Model $ m , $ table = null ) { if ( ! isset ( $ table ) ) { $ table = $ m -> table ; } if ( ! $ this -> data [ $ table ] ) { return false ; // no records at all in table } reset ( $ this -> data [ $ table ] ) ; $ key = key ( $ this -> data [ $ table ] ) ; $ row = $ this -> load ( $ m , $ key , $ table ) ; $ m -> id = $ key ; return $ row ; }
Tries to load first available record and return data record.
Doesn't throw exception if model can't be loaded or there are no data records.

@param Model $m
@param mixed $table

@return array|false
Tries to load first available record and return data record . Doesn t throw exception if model can t be loaded or there are no data records .