Stud.IP  jlu_3.3 Revision
DirectoryEntry Class Reference
Inheritance diagram for DirectoryEntry:
Inheritance graph
Collaboration diagram for DirectoryEntry:
Collaboration graph

Public Member Functions

 __construct ($id=null)
 
 move ($parent_id)
 
 getParent ()
 
 indexInParent ()
 
 isDirectory ()
 
 getSize ()
 
 getDownloadLink ($inline=false, $absolute=false)
 
 checkAccess ($user_id=null, $throw_exception=true)
 
- Public Member Functions inherited from SimpleORMap
 __construct ($id=null)
 
 __clone ()
 
 getRelationOptions ($relation)
 
 getTableMetadata ()
 
 hasAutoIncrementColumn ()
 
 setId ($id)
 
 getId ()
 
 getNewId ()
 
 toArray ($only_these_fields=null)
 
 toRawArray ($only_these_fields=null)
 
 toArrayRecursive ($only_these_fields=null)
 
 getValue ($field)
 
 getRelationValue ($relation, $field)
 
 setValue ($field, $value)
 
 __get ($field)
 
 __set ($field, $value)
 
 __isset ($field)
 
 offsetExists ($offset)
 
 offsetGet ($offset)
 
 offsetSet ($offset, $value)
 
 offsetUnset ($offset)
 
 getIterator ()
 
 count ()
 
 isField ($field)
 
 isAdditionalField ($field)
 
 isAliasField ($field)
 
 setData ($data, $reset=false)
 
 haveData ()
 
 isNew ()
 
 isDeleted ()
 
 setNew ($is_new)
 
 getWhereQuery ()
 
 restore ()
 
 store ()
 
 triggerChdate ()
 
 delete ()
 
 isDirty ()
 
 isFieldDirty ($field)
 
 revertValue ($field)
 
 getPristineValue ($field)
 
 initRelation ($relation)
 
 resetRelation ($relation)
 

Static Protected Member Functions

static configure ($config=array())
 
- Static Protected Member Functions inherited from SimpleORMap
static configure ($config=array())
 
static tableScheme ($db_table)
 

Additional Inherited Members

- Static Public Member Functions inherited from SimpleORMap
static expireTableScheme ()
 
static find ($id)
 
static exists ($id)
 
static countBySql ($sql=1, $params=array())
 
static create ($data)
 
static build ($data, $is_new=true)
 
static buildExisting ($data)
 
static import ($data)
 
static findBySQL ($sql, $params=array())
 
static findByObject (SimpleORMap $object)
 
static findOneBySQL ($where, $params=array())
 
static findThru ($foreign_key_value, $options)
 
static findEachBySQL ($callable, $sql, $params=array())
 
static findMany ($pks=array(), $order='', $order_params=array())
 
static findEachMany ($callable, $pks=array(), $order='', $order_params=array())
 
static findAndMapBySQL ($callable, $where, $params=array())
 
static findAndMapMany ($callable, $pks=array(), $order='', $order_params=array())
 
static deleteBySQL ($where, $params=array())
 
static toObject ($id_or_object)
 
static __callStatic ($name, $arguments)
 
- Protected Member Functions inherited from SimpleORMap
 _getId ($field)
 
 _setId ($field, $value)
 
 _getAdditionalValueFromRelation ($field)
 
 _setAdditionalValueFromRelation ($field, $value)
 
 _getAdditionalValue ($field)
 
 _setAdditionalValue ($field, $value)
 
 parseRelationOptions ($type, $name, $options)
 
 getTableScheme ()
 
 storeRelations ($only_these=null)
 
 deleteRelations ()
 
 initializeContent ()
 
 applyCallbacks ($type)
 
 registerCallback ($types, $cb)
 
 unregisterCallback ($types, $cb)
 
 cbAutoIncrementColumn ($type)
 
 cbAutoKeyCreation ()
 
 cbNotificationMapper ($cb_type)
 
 setSerializedValue ($field, $value)
 
- Protected Attributes inherited from SimpleORMap
 $content = array()
 
 $content_db = array()
 
 $is_new = true
 
 $is_deleted = false
 
 $db_table = ''
 
 $db_fields = null
 
 $pk = null
 
 $default_values = array()
 
 $serialized_fields = array()
 
 $alias_fields = array()
 
 $additional_fields = array()
 
 $relations = array()
 
 $has_many = array()
 
 $has_one = array()
 
 $belongs_to = array()
 
 $has_and_belongs_to_many = array()
 
 $registered_callbacks
 
 $known_slots = array()
 
 $reserved_slots = array('value','newid','iterator','tablemetadata', 'relationvalue','wherequery','relationoptions','data','new','id')
 
 $notification_map = array()
 
 $additional_data = array()
 
- Static Protected Attributes inherited from SimpleORMap
static $schemes = null
 
static $config = array()
 

Detailed Description

File.php

Class to represent file and directory entries inside a directory. This should probably use SimpleORMap.

Copyright (c) 2013 Elmar Ludwig

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

Constructor & Destructor Documentation

◆ __construct()

__construct (   $id = null)

Initialize a new directory entry object for the given id.

Parameters
string$iddirectory entry id
Exceptions
InvalidArgumentExceptionif id of directory entry is invalid

Reimplemented from SimpleORMap.

Here is the call graph for this function:

Member Function Documentation

◆ checkAccess()

checkAccess (   $user_id = null,
  $throw_exception = true 
)

Checks whether a user has access to the current directory entry.

Parameters
mixed$user_idId of the user or null for current user (default)
bool$throw_exceptionThrow an AccessDeniedException instead of returning false
Returns
bool indicating whether the user may access this directory entry
Exceptions
AccessDeniedExceptionif $throw_exception is true and the user may not access this directory entry
See also
File::checkAccess

◆ configure()

static configure (   $config = array())
staticprotected

Configures this model with additional fields for the file and directory reference as well as a complete notification map.

Reimplemented from SimpleORMap.

Here is the call graph for this function:

◆ getDownloadLink()

getDownloadLink (   $inline = false,
  $absolute = false 
)
Here is the call graph for this function:

◆ getParent()

getParent ( )

Returns the Parent from an Entry.

Returns
DirectoryEntry Parent entry
Exceptions
Exceptionif no valid parent is found
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSize()

getSize ( )
Here is the call graph for this function:

◆ indexInParent()

indexInParent ( )

Retrieves the index/offset of a file inside this directory.

Parameters
String$ref_idId of the file to retrieve the index for
Returns
mixed Either the numeric index or false if file was not found
Here is the call graph for this function:

◆ isDirectory()

isDirectory ( )
Here is the caller graph for this function:

◆ move()

move (   $parent_id)

Set the new parent_id.

Parameters
String$parent_idDirectory id of the new parent
Todo:
Prevent impossible situations (move a folder inside itself)
Here is the call graph for this function:

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