Get franchise information

@param integer $franchiseId
@param array $fields
@return \StdClass
@throws \Exception
191544
public function getFranchise($franchiseId, $fields = ['*'])
    {
        $apiUrl = $this->getEndpoint('franchises');
        $apiUrl .= $franchiseId;

        $params = array(
            'fields' => implode(',', $fields)
        );

        $apiData = $this->apiGet($apiUrl, $params);

        return $this->decodeSingle($apiData);
    }
1231381
public function get(string $id, array $fields = []): CallActivity
    {
        $response = $this->client->get($this->prepareUrlForKey('get-call', ['id' => $id]), ['_fields' => $fields]);

        return new CallActivity($response->getDecodedBody());
    }
560060
public function getRecord(int $recordID)
    {
        foreach ($this->getRecords() as $key => $record) {
            if ($record[$this->primaryKey] == $recordID) {
                return $record;
            }
        }

        return null;
    }
1245685
protected function createSelectQuery(array $fields = [], array $criteria = [], array $orderBy = [], $distinct = true)
	{
		if ($this->objectManager instanceof \Doctrine\ORM\EntityManager) {
			/** @var \Doctrine\ORM\QueryBuilder $builder */
			$builder = $this->objectManager->createQueryBuilder();
			$builder->select(empty($fields) ? 'p' : 'p.' . implode(', p.', $fields));
			
			if (true === $distinct) {
				$builder->distinct();
			}
			
			$builder->from($this->className, 'p')
					->setFirstResult($this->getItemOffset())
					->setMaxResults($this->itemPerPage);
			
			foreach ($orderBy as $key => $value) {
				$builder->orderBy(sprintf('p.%s', $key), $value);
			}
		} elseif ($this->objectManager instanceof \Doctrine\ODM\MongoDB\DocumentManager) {
			/** @var \Doctrine\ODM\MongoDB\Query\Builder $builder */
			$builder = $this->objectManager->createQueryBuilder($this->className);
			
			if (false === empty($fields)) {
				$builder->select($fields);
			}
			
			$builder->skip($this->getItemOffset())
					->limit($this->itemPerPage);
			
			foreach ($orderBy as $key => $value) {
				$builder->sort($key, $value);
			}
		} else {
			throw new ObjectManagerNotSupportedException(sprintf('Doctrine object manager class "%s" is not supported.', get_class($this->objectManager)));
		}
		
		$this->qbHandler->applyExprFromArray($builder, 'p', $criteria);
		
		return $builder->getQuery();
	}
346660
public function getCompanyById($id)
    {
        $id = (int) $id;
        $id = max(0, $id);

        return $this->request('companies/'.$id);
    }
913922
static public function getFromId($networkId, $field = "name")
    {
        foreach (self::$networkInfos as $name => $spec) {
            if ($spec["id"] !== (int) $networkId) continue;

            if ($field === "name")
               return $name;
            elseif (in_array($field, array_keys($spec)))
                return $spec[$field];
            else
                // Field not recognized
                return null;
        }

        // Network ID not recognized
        return null;
    }
1049395
public static function getProducer($appId = Producer::DEFAULT_APP_ID)
    {
        if (null === $appId) {
            $appId = Producer::DEFAULT_APP_ID;
        }

        if (!array_key_exists($appId, static::$producers)) {

            if (array_key_exists($appId, static::$builders)) {
                $func = static::$builders[$appId];
                static::addProducer($func($appId));
                unset(static::$builders[$appId]);

                return static::getProducer($appId);
            }

            throw new Exception\FacadeException("Producer with appId: '{$appId}' not exists yet!");
        }

        return static::$producers[$appId];
    }
2361
public function getSubscriptionByExtUid($subscriptionExtUid)
    {
        /** @var SubscriptionFbApi $response */
        $response = $this->call(new Request('subscription.get', array('subscription_ext_uid' => $subscriptionExtUid)), 'DVelopment\FastBill\Model\SubscriptionFbApi');
        $subscriptions = $response->getResponse()->getSubscriptions();

        return reset($subscriptions);
    }
640226
public function getUserTypeEntityById($fieldId) {
        $item = \CUserTypeEntity::GetByID($fieldId);
        if (empty($item)) {
            return false;
        }

        if ($item['USER_TYPE_ID'] == 'enumeration') {
            $item['ENUM_VALUES'] = $this->getEnumValues($fieldId, false);
        }

        return $item;
    }
1258378
public function get($countryId, array $fields = array())
    {
        $params = array();
        if (!empty($fields)) {
            $params['fields'] = implode(',', $fields);
        }
        $endpoint = '/admin/countrys/'.$countryId.'.json';
        $response = $this->request($endpoint, 'GET', $params);
        return $this->createObject(Country::class, $response['country']);
    }
1296517
public function getBranch($id, array $additionalFields = array())
    {
        return $this->getSingle(
            'catalog/branch/get',
            'Branch',
            array('id' => (int)$id, 'fields' => self::getArray($additionalFields))
        );
    }
976061
public function getChampion($championId)
	{
		if ( ! isset($this->info['champions'][$championId]))
		{
			return null;
		}

		return $this->info['champions'][$championId];
	}
94611
public static function getOne($id, $fields = null)
    {
        $table = self::getTableNameFromClass();

        if ($fields != null && is_array($fields)) {
            $query = "SELECT ". implode(', ', $fields) ." FROM $table WHERE id = $id";
        } else {
            $query = "SELECT * FROM $table WHERE id = $id";
        }

        $res = [];

        $results = Connection::db()->query($query);
        $results->setFetchMode(PDO::FETCH_ASSOC);

        while ($row = $results->fetch()) {
            array_push($res, $row);
        }

        if (!empty($res)) {
            return $res;
        } else {
            throw new PotatoException('There is no user with id '. $id);
        }
    }
147697
public function getChildren($locationId)
    {
        try {
            return $this->innerGateway->getChildren($locationId);
        } catch (DBALException $e) {
            throw new RuntimeException('Database error', 0, $e);
        } catch (PDOException $e) {
            throw new RuntimeException('Database error', 0, $e);
        }
    }
1181658
public function get($fields = [])
    {
        $fields = empty($fields) ? $this->fields : $fields;

        $this->haveFields($fields);

        $query = $this->createQuery($fields);

        return new ServiceCollection($this->getService(), $this->service->query($query)->getEntries());
    }
536631
public static function findField($fieldsList, $fieldId)
    {
        $fields = self::filterFieldList($fieldsList, $fieldId);

        if (1 != count($fields)) {
            return null;
        }

        return array_shift($fields);
    }
189179
public function get($idOrKey, array $fields = null)
    {
        $parameters = $fields ?
            sprintf(
                '?%s',
                $this->createUriParameters(
                    ['fields' => implode(',', $fields)]
                )
            )
            : ''
        ;

        return $this->getRequest(sprintf('issue/%s%s', $idOrKey, $parameters));
    }