Get the query builder of the 'friend' model

@param string $groupSlug

@return \Illuminate\Database\Eloquent\Builder
334016
private function getFollowingQueryBuilder()
    {

        $following = $this->findFollowing(Status::ACCEPTED)->get(['sender_id', 'recipient_id']);
        $recipients  = $following->pluck('recipient_id')->all();
        $senders     = $following->pluck('sender_id')->all();

        return $this->where('id', '!=', $this->getKey())->whereIn('id', array_merge($recipients, $senders));
    }
383536
public function get($groupKey, $memberKey, $optParams = array()) {
      $params = array('groupKey' => $groupKey, 'memberKey' => $memberKey);
      $params = array_merge($params, $optParams);
      $data = $this->__call('get', array($params));
      if ($this->useObjects()) {
        return new Google_Member($data);
      } else {
        return $data;
      }
    }
182302
protected function getModelSessionKey($modelSlug = null)
    {
        $modelSlug = (null === $modelSlug) ? $this->getModelSlug() : $modelSlug;

        return $this->core->config('session.prefix')
             . 'model:' . $modelSlug;
    }
65000
public function getVerticesGroup($group)
    {
        $vertices = array();
        foreach ($this->graph->getVertices()->getMap() as $vid => $vertex) {
            if ($vertex->getGroup() === $group) {
                $vertices[$vid] = $vertex;
            }
        }

        return new Vertices($vertices);
    }
1298339
protected function getSSLBuilder($config)
    {
        if (empty($config)) {
            return null;
        }

        $ssl = \Cassandra::ssl();
        $serverCert = array_get($config, 'server_cert_path');
        $clientCert = array_get($config, 'client_cert_path');
        $privateKey = array_get($config, 'private_key_path');
        $passPhrase = array_get($config, 'key_pass_phrase');

        if (!empty($serverCert) && !empty($clientCert)) {
            if (empty($privateKey)) {
                throw new InternalServerErrorException('No private key provider.');
            }

            return $ssl->withVerifyFlags(\Cassandra::VERIFY_PEER_CERT)
                ->withTrustedCerts($serverCert)
                ->withClientCert($clientCert)
                ->withPrivateKey($privateKey, $passPhrase)
                ->build();
        } elseif (!empty($serverCert)) {
            return $ssl->withVerifyFlags(\Cassandra::VERIFY_PEER_CERT)
                ->withTrustedCerts(getenv('SERVER_CERT'))
                ->build();
        } elseif (true === boolval(array_get($config, 'ssl', array_get($config, 'tls', false)))) {
            return $ssl->withVerifyFlags(\Cassandra::VERIFY_NONE)
                ->build();
        } else {
            return null;
        }
    }
1128387
public function insertGroup(Group $group)
    {
        $q = $this->dbHandler->createInsertQuery();
        $q->insertInto(
            $this->dbHandler->quoteTable('ezcontentclassgroup')
        )->set(
            $this->dbHandler->quoteColumn('id'),
            $this->dbHandler->getAutoIncrementValue('ezcontentclassgroup', 'id')
        )->set(
            $this->dbHandler->quoteColumn('created'),
            $q->bindValue($group->created, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('creator_id'),
            $q->bindValue($group->creatorId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('modified'),
            $q->bindValue($group->modified, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('modifier_id'),
            $q->bindValue($group->modifierId, null, \PDO::PARAM_INT)
        )->set(
            $this->dbHandler->quoteColumn('name'),
            $q->bindValue($group->identifier)
        );
        $q->prepare()->execute();

        return $this->dbHandler->lastInsertId(
            $this->dbHandler->getSequenceName('ezcontentclassgroup', 'id')
        );
    }
862644
public function getSelectQueryBuilder($srid = null)
    {
        $driver             = $this->driver;
        $geomFieldCondition = $driver->getGeomAttributeAsWkt($this->geomField, $srid ? $srid : $this->getSrid());
        $queryBuilder       = $driver->getSelectQueryBuilder(array($geomFieldCondition));
        return $queryBuilder;
    }
777107
public function getGroup($group)
    {
        $timeStamp = time();
        if ($group instanceof BundleEntity\MemberGroup) {
            return new ModelResponse($group, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
        }
        $result = null;
        switch ($group) {
            case is_numeric($group):
                $result = $this->em->getRepository($this->entity['mg']['name'])->findOneBy(array('id' => $group));
                break;
            case is_string($group):
                $result = $this->em->getRepository($this->entity['mg']['name'])->findOneBy(array('code' => $group));
                break;
        }
        if (is_null($result)) {
            return new ModelResponse($result, 0, 0, null, true, 'E:D:002', 'Unable to find request entry in database.', $timeStamp, time());
        }

        return new ModelResponse($result, 1, 0, null, false, 'S:D:002', 'Entries successfully fetched from database.', $timeStamp, time());
    }
1198849
public function query() : Builder
	{
		if (trim($seed = $this->seed) !== '') {
			$this->builder->where(function ($query) use ($seed) {
				return $this->resolveQuery($query, $seed);
			});
		}

		return $this->builder;
	}
219227
public function getBySlug($sSlug, $bOnlySelectable = false)
    {
        $aAvailable = $this->getAll($bOnlySelectable);

        foreach ($aAvailable as $oType) {

            if ($oType->slug == $sSlug) {

                if (!isset($oType->instance)) {
                    $oType->instance = Factory::factory(
                        $oType->component,
                        $oType->provider
                    );
                }

                return $oType->instance;
            }
        }

        return null;
    }
902315
public static function queryBuilderStatic(array $options = []) : \Object\Query\Builder {
		$class = get_called_class();
		$model = new $class();
		return $model->queryBuilder($options);
	}
697687
public function findByGroup(Group $group)
    {
        return $this->createQueryBuilder('o')
            ->select('o.id', 'o.name')
            ->join('o.groups', 'g')
            ->where('g = :group')
            ->groupBy('o.id')
            ->setParameter(':group', $group)
            ->getQuery()
            ->getArrayResult();
    }
1294948
public function group($grouper, bool $saveKeys = false): self
    {
        // init
        $result = [];

        // Iterate over values, group by property/results from closure.
        foreach ($this->getGenerator() as $key => $value) {
            if (\is_callable($grouper)) {
                $groupKey = $grouper($value, $key);
            } else {
                $groupKey = $this->get($grouper, null, $this->getArray());
            }

            $newValue = $this->get($groupKey, null, $result);

            if ($groupKey instanceof self) {
                $groupKey = $groupKey->getArray();
            }

            if ($newValue instanceof self) {
                $newValue = $newValue->getArray();
            }

            // Add to results.
            if ($groupKey !== null) {
                if ($saveKeys) {
                    $result[$groupKey] = $newValue;
                    $result[$groupKey][$key] = $value;
                } else {
                    $result[$groupKey] = $newValue;
                    $result[$groupKey][] = $value;
                }
            }
        }

        return static::create(
            $result,
            $this->iteratorClass,
            false
        );
    }
246192
public function load($locale, $group, $namespace = null)
    {
        $query = \DB::table('translations')
            ->where('locale', $locale)
            ->where('group', $group);

        return ServiceProvider::pluckOrLists($query, 'value', 'name');
    }
934607
public function getDateFormatBySlug($sSlug)
    {
        $aFormats = $this->getAllDateFormat();
        foreach ($aFormats as $oFormat) {
            if ($oFormat->slug === $sSlug) {
                return $oFormat;
            }
        }

        return null;
    }
637909
public function findAccountsForGroup(Entity\GroupNode $groupNode)
    {
        if ($this->getConfiguration()->getMembershipUseAttributeFromGroup() === true) {
            return $this->findAccountsForGroupUsingGroupAttribute($groupNode);
        } elseif ($this->getConfiguration()->getMembershipUseAttributeFromUser() === true) {
            return $this->findAccountsForGroupUsingAccountAttribute($groupNode);
        }

        return new Collection\AccountNodeCollection(new Collection\DnIterator($this->connection, array()));
    }
596146
public static function getBySlug($sSlug): ?Component
    {
        $aComponents = static::available();

        foreach ($aComponents as $oComponent) {
            if ($oComponent->slug === $sSlug) {
                return $oComponent;
            }
        }

        return null;
    }