Get once result

@return object
330980
public function beginOnce()
    {
        $this->createQuery();

        GapOrm::getDriver()->query($this->getQuery(), []);

        $obj = GapOrm::getDriver()->selectOnce();
        $obj = $this->convertFromDB($obj);

        if ($obj) {
            return $obj;
        }

        return null;
    }
371076
public function once(bool $set = null)
    {
        if ($set) {
            return $this->setFrequency(AlarmInterface::ONCE);
        }
        return $this->getFrequency() === AlarmInterface::ONCE;
    }
1031637
public function getResults()
    {
        if (! is_array($this->getParentKey())) {
            if (is_null($this->getParentKey())) {
                return $this->getDefaultFor($this->parent);
            }
        }

        return $this->query->first() ?: $this->getDefaultFor($this->parent);
    }
1373027
public function getMtResult()
    {
        $this->logger->info(__FUNCTION__, 'Mt Result: ' . json_encode($this->mtResult));

        return $this->mtResult;
    }
553772
@Override
	public T get() {
		T result = object;
		if (result == null) {
			synchronized (this) {
				result = object;
				if (result == null) {
					object = result = init();
				}
			}
		}
		return result;
	}
177687
public function once(callable $callable, array $args = [])
    {
        return function () use ($callable, $args) {
            static $result;
            if (!$result) {
                $result = $this->invoke($callable, $args);
            }
            return $result;
        };
    }
1302338
function result()
    {
        if ($this->result == null || count($this->result) == 0) {
            return false;
        }
        return $this->result;
    }
1338747
public function getTotalResults()
    {
        $query = $this->deliverQueryObject();
        $query
            ->resetQueryParts(['groupBy', 'orderBy'])
            ->select('count(distinct p.id)')
            ->setMaxResults(1);
        $result = $query->execute()->fetchColumn();

        return (int) $result;
    }
452150
protected function getPrev()
    {
        if (!$this->current)
        {
            return null;
        }
        if ($this->prev !== -1)
        {
            return $this->prev;
        }
        $this->load();
        for ($i = 0; $i < count($this->items); $i++)
        {
            if ($this->items[$i]->id == $this->current->id)
            {
                if ($i > 0)
                {
                    $this->prev = $this->items[$i - 1];
                    return $this->prev;
                }
                break;
            }
        }
        return null;
    }
1107085
public function getResult () : Result
    {
        // Cache
        if ( $this->_Result !== null ) :
            return $this->_Result;
        endif;

            //////

        // Sort pairwise
        $this->_PairwiseSort = $this->pairwiseSort();

        // Ranking calculation
        $this->makeArcs();

        // Make Stats
        $this->_Stats['tally'] = $this->_PairwiseSort;
        $this->_Stats['arcs'] = $this->_Arcs;

        // Make Result      
        return $this->_Result = $this->createResult($this->makeResult());
    }
1171873
public function get()
    {
        $rpc = null;
        if ($this->count > 0) {
            $rpc = $this->items[$this->index];
            if (++$this->index > $this->count - 1) {
                $this->index = 0;
            }
        }

        return $rpc;
    }
66525
function onetime() {
        if (called) return value;

        called = 1;
        value = fn.apply(this, arguments);
        fn = null;

        return value;
      }
974691
public function first()
    {
        $result = $this->limit(1)->get();

        return ($result !== null && \count($result) !== 0) ? $result[0] : null;
    }
1198816
public function get()
    {
         // run the callbacks to retirve the results
        $results = $this->executeResultFetcher();

        // we always exprect an array here!
        if (!is_array($results) || empty($results))
        {
            $results = array();
        }

        // In case we should forward a key means using a value
        // from every result as array key.
        if ((!empty($results)) && $this->forwardKey !== false && is_string($this->forwardKey)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $result) 
            {
                $results[$result[$this->forwardKey]] = $result;
            }
        }

        // Group the resuls by a items value
        if ((!empty($results)) && $this->groupResults !== false && is_string($this->groupResults)) 
        {
            $rawResults = $results;
            $results = array();

            // check if the collection is beeing fetched 
            // as an associated array 
            if (!is_array(reset($rawResults)))
            {
                throw new Exception('Cannot forward key, the result is no associated array.');
            }

            foreach ($rawResults as $key => $result) 
            {
                $results[$result[$this->groupResults]][$key] = $result;
            }
        }

        // when the limit is specified to exactly one result we
        // return directly that one result instead of the entire array
        if ($this->limit === 1) 
        {
            $results = reset($results);
        }

        return $results;
    }
1094877
public function self()
    {
        $result = $this->itemIterator ? $this->itemIterator->current() : $this->item;
        $this->resetLocalScope();

        return $result;
    }
1240172
public function get()
    {
        if (! $this->singleton) {
            return call_user_func($this->loader);
        }
        if ($this->object === null) {
            $this->object = call_user_func($this->loader);
        }

        return $this->object;
    }
1301699
public function getResult()
    {
        if ($this->autoFormat && ! empty($this->object)) {
            return $this->object;
        }

        return $this->content;
    }