Elgg  Version master
Public Member Functions | Public Attributes | Protected Attributes | List of all members
Elgg\EntityDirLocator Class Reference

Locate the relative path of an entity's data dir. More...

Public Member Functions

 __construct (int $guid)
 Find an entity's data dir. More...
 
 getPath ()
 Construct a file path matrix for an entity. More...
 
 __toString ()
 String casting magic method. More...
 

Public Attributes

const BUCKET_SIZE = 5000
 Number of entries per matrix dir. More...
 

Protected Attributes

 $guid
 

Detailed Description

Locate the relative path of an entity's data dir.

This returns paths like: '1/27/'.

Note
This class does not require the Elgg engine to be loaded and is suitable for being used directly.

Definition at line 17 of file EntityDirLocator.php.

Constructor & Destructor Documentation

Elgg\EntityDirLocator::__construct ( int  $guid)

Find an entity's data dir.

Parameters
int$guidGUID of the entity.
Exceptions
RangeException

Definition at line 36 of file EntityDirLocator.php.

Member Function Documentation

Elgg\EntityDirLocator::__toString ( )

String casting magic method.

Returns
string

Definition at line 62 of file EntityDirLocator.php.

Elgg\EntityDirLocator::getPath ( )

Construct a file path matrix for an entity.

As of 1.9.0 matrixes are based on GUIDs and separated into dirs of 5000 entries with the dir name being the lower bound for the GUID.

Returns
string The path with trailing '/' where the entity's data will be stored relative to the data dir.

Definition at line 51 of file EntityDirLocator.php.

Member Data Documentation

Elgg\EntityDirLocator::$guid
protected

Definition at line 27 of file EntityDirLocator.php.

const Elgg\EntityDirLocator::BUCKET_SIZE = 5000

Number of entries per matrix dir.

DO NOT CHANGE!

Definition at line 22 of file EntityDirLocator.php.


The documentation for this class was generated from the following file: