Returns Referers of unique Visitors.
@access		public
@return 	array
329646
public function getReferers( $skip )
	{
		$referers		= array();
		foreach( $this->data as $entry )
		{
			if( $entry['remote_addr'] != $this->skip )
			{
				if( $entry['referer_uri'] && !preg_match( "#.*".$skip.".*#si", $entry['referer_uri'] ) )
				{
					if( isset( $referers[$entry['referer_uri']] ) )
						$referers[$entry['referer_uri']] ++;
					else
						$referers[$entry['referer_uri']]	= 1;
				}
			}
		}
		arsort( $referers );
		foreach( $referers as $referer => $count )
			$lines[]	= "<tr><td>".$referer."</td><td>".$count."</td></tr>";
		$lines	= implode( "\n\t", $lines );
		$content	= "<table>".$lines."</table>";
		return $content;
	}
922615
public function getDereferenced()
    {
        if ($this->dereferenced_field) {
            return $this->dereferenced_field;
        }
        $f = preg_replace('/_id$/', '', $this->short_name);
        if ($f != $this->short_name) {
            return $f;
        }

        $f = $this->short_name.'_text';
        if ($this->owner->hasElement($f)) {
            return $f;
        }

        $f = $this->_unique($this->owner->elements, $f);
        $this->dereferenced_field = $f;

        return $f;
    }
504434
public function getSitesGroups()
    {
        $db = $this->getDb();
        $groups = $db->fetchAll("SELECT DISTINCT `group` FROM " . $this->table);

        $cleanedGroups = array();
        foreach ($groups as $group) {
            $cleanedGroups[] = $group['group'];
        }

        return $cleanedGroups;
    }
647758
public function accessLevels()
    {
        $accessLevels = [];
        foreach ($this->all() as $page) {
            if (isset($page->header()->access)) {
                if (\is_array($page->header()->access)) {
                    foreach ($page->header()->access as $index => $accessLevel) {
                        if (\is_array($accessLevel)) {
                            foreach ($accessLevel as $innerIndex => $innerAccessLevel) {
                                $accessLevels[] = $innerIndex;
                            }
                        } else {
                            $accessLevels[] = $index;
                        }
                    }
                } else {
                    $accessLevels[] = $page->header()->access;
                }
            }
        }

        return array_unique($accessLevels);
    }
810660
public function getGuestList()
    {
        $reservationClass = Reservation::singleton()->getClassName();
        $attendeeClass = Attendee::singleton()->getClassName();
        return Attendee::get()
            ->leftJoin($reservationClass, "`$attendeeClass`.`ReservationID` = `$reservationClass`.`ID`")
            ->filter(array(
                'EventID' => $this->owner->ID
            ))
            ->filterAny(array(
                'ReservationID' => 0,
                'Status' => Reservation::STATUS_PAID
            ));
    }
604494
private static function getGuessers(): array
    {
        if (! self::$nativeGuessersLoaded) {
            if (MimeTypeFileExtensionGuesser::isSupported()) {
                self::$guessers[] = MimeTypeFileExtensionGuesser::class;
            }

            if (MimeTypeFileInfoGuesser::isSupported()) {
                self::$guessers[] = MimeTypeFileInfoGuesser::class;
            }

            if (MimeTypeFileBinaryGuesser::isSupported()) {
                self::$guessers[] = MimeTypeFileBinaryGuesser::class;
            }

            self::$nativeGuessersLoaded = true;
        }

        return self::$guessers;
    }
197520
public function getOriginalPaths()
    {
        if (null === $this->originalReferrerPaths) {
            $this->originalReferrerPaths = [];
            if (self::INITIALIZED_FROM_COLLECTION === $this->initialized) {
                $uow = $this->dm->getUnitOfWork();
                foreach ($this->collection as $referrer) {
                    $this->originalReferrerPaths[] = $uow->getDocumentId($referrer);
                }
            } else {
                $properties = $this->getReferrerProperties();
                foreach ($properties as $property) {
                    $this->originalReferrerPaths[] = $property->getPath();
                }
            }
        }

        return $this->originalReferrerPaths;
    }
597141
public function users()
    {
        $list  = [];
        $users = User::all();

        foreach ($users as $key => $user) {
            $list[$user->id] = $user->name;
        }

        return $list;
    }
34305
public function index()
    {
        $visitors = Visitor::with(['user', 'device', 'agent', 'geoip', 'referer', 'cookie', 'language', 'activities'])
            ->paginate(50);

        $this->setTitle($title = trans('tracker::visitors.titles.visitors-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.visitors.index', compact('visitors'));
    }
143055
public function getLinks()
    {
        if ($this->filterCallback === null) {
            $links = $this->links;
        } else {
            $links = array_filter($this->links, function (Link $linkObj) {
                /*@var $linkObj Link */
                return $linkObj->shouldNotVisit() === false;
            });
        }
        
        return $links;
    }
118006
public function getPrimaryKeys(): array
    {
        $primaryColumns = [];
        foreach ($this->getColumns() as $column) {
            if ($column->getAbstractType() == 'primary' || $column->getAbstractType() == 'bigPrimary') {
                if (!in_array($column->getName(), $this->primaryKeys)) {
                    //Only columns not listed as primary keys already
                    $primaryColumns[] = $column->getName();
                }
            }
        }

        return array_unique(array_merge($this->primaryKeys, $primaryColumns));
    }
340871
public function getIncludeUserIds()
    {
        $userIds = array();
        $roleUsers = $this->role->getUsers();
        foreach ($roleUsers as $user) {
            array_push($userIds, $user->getId());
        }
        $roleGroups = $this->role->getGroups();
        foreach ($roleGroups as $group) {
            $userIds = array_merge($userIds, $group->getUserIds());
        }
        $userIds = array_unique($userIds);

        return $userIds;
    }
1164610
public function getVisitors()
	{
		if( !$this->_open )
		{
			trigger_error( "Log File not read", E_USER_ERROR );
			return 0;
		}
		$remote_addrs	= array();	
		$counter	= 0;
		foreach( $this->data as $entry )
		{
			if( $entry['remote_addr'] != $this->skip )
			{
				if( isset( $remote_addrs[$entry['remote_addr']] ) )
				{
					if( $remote_addrs[$entry['remote_addr']] < $entry['timestamp'] - 30 * 60 )
						$counter ++;
					$remote_addrs[$entry['remote_addr']]	= $entry['timestamp'];
				}
				else
				{
					$counter ++;
					$remote_addrs[$entry['remote_addr']]	= $entry['timestamp'];
				}
			}
		}
		return $counter;
	}
474052
private function getReferersCountFromSessionActivities($start, $end)
    {
        return $this->getVisitsFilteredByDateRange($start, $end)
            ->transform(function (VisitorActivity $visit) {
                return [
                    'name' => $visit->hasReferer()
                        ? $visit->referer->domain->name
                        : trans('tracker::generals.undefined'),
                ];
            })
            ->groupBy('name')
            ->transform(function (Collection $items, $key) {
                return [
                    'name'  => $key,
                    'count' => $items->count(),
                ];
            })
            ->sortByDesc('count');
    }
1090403
public function UniqueElementEntries()
	{
		$result = array(); // Build a new array

		foreach ( $this->elements as $name => $entries )
		{
			if ( ! isset( $result[ $name ] ) ) $result[ $name ] = array();

			foreach ( $entries as $key => $entry )
			{
				if ( isset( $entry['tuple_elements'] ) )
				{
					// Just take it
					$result[ $name ][] = $entry;
					continue;
				}

				if ( $this->entry_is_unique( $result[ $name ], $entry ) )
					$result[ $name ][] = $entry;
			}
		}

		return new InstanceElementsFilter( $this, $result );
	}
441755
private function fetchFirstVisit()
    {
        $response = Request::processRequest('Live.getFirstVisitForVisitorId', [
            'idSite' => $this->getIdSite(),
            'visitorId' => $this->getVisitorId(),
        ]);

        return $response->getFirstRow();
    }
416893
public function getOriginalPaths()
    {
        if (null === $this->originalReferencePaths) {
            $this->originalReferencePaths = [];
            if (self::INITIALIZED_FROM_COLLECTION === $this->initialized) {
                $uow = $this->dm->getUnitOfWork();
                foreach ($this->collection as $reference) {
                    $this->originalReferencePaths[] = $uow->getDocumentId($reference);
                }
            } else {
                if (self::REFERENCE_TYPE_UUID === $this->referenceType) {
                    $nodes = $this->dm->getPhpcrSession()->getNodesByIdentifier($this->referencedNodes);
                    foreach ($nodes as $node) {
                        $this->originalReferencePaths[] = $node->getPath();
                    }
                } else {
                    $this->originalReferencePaths = $this->referencedNodes;
                }
            }
        }

        return $this->originalReferencePaths;
    }