src/Ease/SQL/Orm.php
public function loadFromSQL($itemID = null)
    {
        $rowsLoaded = null;
        if (is_null($itemID)) {
            $itemID = $this->getMyKey();
        }
        $sqlResult              = $this->getDataFromSQL($itemID);
        $this->multipleteResult = (count($sqlResult) > 1);

        if ($this->multipleteResult && is_array($sqlResult)) {
            $results = [];
            foreach ($sqlResult as $id => $data) {
                $this->takeData($data);
                $results[$id] = $this->getData();
            }
            $this->data = $results;
        } else {
            if (isset($sqlResult[0])) {
                $this->takeData($sqlResult[0]);
            }
        }
        if (!empty($this->data)) {
            $rowsLoaded = count($this->data);
        }

        return $rowsLoaded;
    }
public function loadFromSQL($itemID = null)
    {
        $rowsLoaded = null;
        if (is_null($itemID)) {
            $itemID = $this->getMyKey();
        }
        $sqlResult              = $this->getDataFromSQL($itemID);
        $this->multipleteResult = (count($sqlResult) > 1);

        if ($this->multipleteResult && is_array($sqlResult)) {
            $results = [];
            foreach ($sqlResult as $id => $data) {
                $this->takeData($data);
                $results[$id] = $this->getData();
            }
            $this->data = $results;
        } else {
            if (isset($sqlResult[0])) {
                $this->takeData($sqlResult[0]);
            }
        }
        if (!empty($this->data)) {
            $rowsLoaded = count($this->data);
        }

        return $rowsLoaded;
    }
Načte z SQL data k aktuálnímu $ItemID a použije je v objektu.

@param int   $itemID     klíč záznamu

@return array Results