Scalr\Tests\Functional\Api\V2\ApiTest::getDbObject PHP Method

getDbObject() protected method

Get db object
protected getDbObject ( string $objectName, string $criteria, string $entityClass, array $params ) : mixed
$objectName string api object name
$criteria string search criteria
$entityClass string
$params array array params
return mixed
    protected function getDbObject($objectName, $criteria, $entityClass, $params)
    {
        if (isset($this->dbObjectMapping[$objectName])) {
            $function = $this->dbObjectMapping[$objectName];
            if (method_exists($this, $function)) {
                return $this->{$function}($criteria, $params);
            } else {
                $this->markTestIncomplete(sprintf('% function does not exist', $function));
            }
        }
        static::toDelete($entityClass, [$criteria]);
        return $entityClass::findPk($criteria);
    }