src/Shop/AcumulusEntryManager.php
protected function convertDbResultToAcumulusEntries($result, $ignoreLock = true)
    {
        if (empty($result)) {
            $result = null;
        } elseif (is_object($result)) {
            $result = $this->container->getAcumulusEntry($result);
            if ($ignoreLock && $result->isSendLock()) {
                $result = null;
            }
        } else {
            // It's a non empty array of results.
            foreach ($result as &$record) {
                $record = $this->container->getAcumulusEntry($record);
                if ($ignoreLock && $record->isSendLock()) {
                    $record = null;
                }
            }
            array_filter($result);
            if (empty($result)) {
                $result = null;
            } elseif (count($result) === 1) {
                $result = reset($result);
            }
        }
        return $result;
    }
protected function convertDbResultToAcumulusEntries($result, $ignoreLock = true)
    {
        if (empty($result)) {
            $result = null;
        } elseif (is_object($result)) {
            $result = $this->container->getAcumulusEntry($result);
            if ($ignoreLock && $result->isSendLock()) {
                $result = null;
            }
        } else {
            // It's a non empty array of results.
            foreach ($result as &$record) {
                $record = $this->container->getAcumulusEntry($record);
                if ($ignoreLock && $record->isSendLock()) {
                    $record = null;
                }
            }
            array_filter($result);
            if (empty($result)) {
                $result = null;
            } elseif (count($result) === 1) {
                $result = reset($result);
            }
        }
        return $result;
    }
protected function convertDbResultToAcumulusEntries ( $ result , $ ignoreLock = true ) { if ( empty ( $ result ) ) { $ result = null ; } elseif ( is_object ( $ result ) ) { $ result = $ this -> container -> getAcumulusEntry ( $ result ) ; if ( $ ignoreLock && $ result -> isSendLock ( ) ) { $ result = null ; } } else { // It's a non empty array of results. foreach ( $ result as & $ record ) { $ record = $ this -> container -> getAcumulusEntry ( $ record ) ; if ( $ ignoreLock && $ record -> isSendLock ( ) ) { $ record = null ; } } array_filter ( $ result ) ; if ( empty ( $ result ) ) { $ result = null ; } elseif ( count ( $ result ) === 1 ) { $ result = reset ( $ result ) ; } } return $ result ; }
Converts the results of a DB query to AcumulusEntries.

@param object|array[]|object[] $result
The DB query result.
@param bool $ignoreLock
Whether to return an entry that serves as a send lock (false) or ignore
it (true)

@return \Siel\Acumulus\Shop\AcumulusEntry|\Siel\Acumulus\Shop\AcumulusEntry[]|null
Converts the results of a DB query to AcumulusEntries .