protected function handleResult(array $result)
    {
        if ($this->onlyCount && isset($result[0]) && is_array($result[0])) {
            return (int)current($result[0]);
        }

        $entities = [];
        foreach ($result as $row) {
            $model = clone $this->getModel();
            $model->populate($row);
            $entities[] = $model;
        }
        return $entities;
    }
protected function handleResult(array $result)
    {
        if ($this->onlyCount && isset($result[0]) && is_array($result[0])) {
            return (int)current($result[0]);
        }

        $entities = [];
        foreach ($result as $row) {
            $model = clone $this->getModel();
            $model->populate($row);
            $entities[] = $model;
        }
        return $entities;
    }
protected function handleResult ( array $ result ) { if ( $ this -> onlyCount && isset ( $ result [ 0 ] ) && is_array ( $ result [ 0 ] ) ) { return ( int ) current ( $ result [ 0 ] ) ; } $ entities = [ ] ; foreach ( $ result as $ row ) { $ model = clone $ this -> getModel ( ) ; $ model -> populate ( $ row ) ; $ entities [ ] = $ model ; } return $ entities ; }
Handle the result of one of the get functions. This attempts to create a new model
with the values returned properly set.

@param array $result

@return \Parable\ORM\Model[]|int
Handle the result of one of the get functions . This attempts to create a new model with the values returned properly set .