
Public Member Functions | |
| __call ($name, $args) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| __construct ($type, $fields, $attributes, $id) | |
| addStylesheet ($pathOrObj) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| delete () | |
| Moves file to /DELETED/ directory. | |
| destroy () | |
| Completely deletes file and children. | |
| getAllPaths () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| getCanonicalShortName () | |
| Retrieves canonical short name of file. | |
| getOrdinal ($parent) | |
| Retrieves ordinal of file with respect to a given parent directory. | |
| getParent ($idx) | |
| Retrieves parent object for specified parent index. | |
| getParentCount () | |
| Retrieves the number of parents this file has. | |
| getParents () | |
| Retrieves directory IDs of all parents of this file. | |
| getPaths ($ref) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| getPermission () | |
| Retrieves SnapPermission object for this file. | |
| getShortName ($parent) | |
| Retrieves short name of file with respect to a given parent directory. | |
| getStylesheets ($onlyThis=false) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| isCanonChildOf ($what) | |
| Alias of isChildOf($what, true). | |
| isChildOf ($what, $strict=false) | |
| Determines whether this file is a child of a given directory. | |
| linkTo ($dest, $shortName="") | |
| Creates new link to another directory. | |
| move ($newParent, $newName= '', $removeOldLink=false) | |
| Convenience method that "moves" file from one directory to another. | |
| removeStylesheets ($which=null) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| renameAt ($parent, $newName) | |
| Changes the name of a link. | |
| reorderIn ($parent, $newOrdinal) | |
| Change the ordering of the file in a given directory. | |
| restore ($newParent= '', $newName= '') | |
| Restores a deleted file to normal tree. | |
| setCanonicalParent ($newParent) | |
| Changes which link is considered the canonical (primary) link. | |
| setDescription ($newDesc) | |
| Changes the description of the file. | |
| setName ($newName) | |
| Changes the "long" name of the file. | |
| unlinkFrom ($src) | |
| Removes existing link to this file. | |
Static Public Member Functions | |
| static | lookup ($path) |
| Perform path lookup for directory or resource. | |
Public Attributes | |
| const | MOVE_BOTTOM |
| set ordinal to max ordinal for parent (for reorderIn()) | |
| const | MOVE_DOWN |
| set ordinal to one more than what it is now (for reorderIn()) | |
| const | MOVE_TOP |
| set ordinal to 1 (for reorderIn()) | |
| const | MOVE_UP |
| set ordinal to one less than what it is now (for reorderIn()) | |
Protected Member Functions | |
| _canChangeMetadata () | |
| _canDelete () | |
| _canDestroy () | |
| _canLinkTo ($dest, $shortName= '') | |
| _canMove ($newParent, $newName=false, $removeOldLink=false) | |
| _canRenameAt ($parent, $newName=false) | |
| _canReorderIn ($parent, $newOrdinal) | |
| _canRestore ($newParent= '', $as= '') | |
| _canSetCanonicalParent ($newParent) | |
| _canUnlinkFrom ($src) | |
| chcanonparent ($newParent) | |
| chorder ($parentId, $newOrdinal) | |
| doDestroy () | |
| loadCanonicalParent () | |
| loadCanonicalPath () | |
| loadMetadata () | |
| INSERT BRIEF DESCRIPTION HERE. | |
| loadPermission () | |
| mklink ($targetId, $name, $first=false) | |
| Creates link between this file and a new parent. | |
| populate () | |
| renamelink ($targetId, $newName) | |
| rmlink ($targetId) | |
| setCanonicalShortName ($csn) | |
| INSERT BRIEF DESCRIPTION HERE. | |
Private Member Functions | |
| checkForCycles ($potLink) | |
| INSERT BRIEF DESCRIPTION HERE. | |
| convertParent ($parent) | |
| recReparentPseudoOrphans ($parentId) | |
| INSERT BRIEF DESCRIPTION HERE. | |
Directories and resources share a number of common attributes and behaviors. This class provides methods for managing those so that they do not need to be duplicated in SnapDirectory and SnapResource.
Notably, files have one or more parents and different names for the link to each parent. Files also have creation and modification times and a permission object associated with them. Almost all of the linkage maintenance for Snap2 happens in this class.
For every function that performs an action that modifies the object, there is a corresponding "can" method that will return whether the operation is allowed/possible. For example, the method to change the short name of a file is renameAt(). The corresponding "can" function is canRenameAt(), which takes the same arguments as renameAt() but doesn't actually perform the action, it just checks to see whether the action is possible. If an operation is not possible, the reason can be retrieved by calling getReason(). No developer error messsage will be displayed unless a true internal error occurred. The "can" methods are not documented because they are dynamically generated.
Definition at line 35 of file SnapFile.php5.
| SnapFile::__construct | ( | $ | type, | |
| $ | fields, | |||
| $ | attributes, | |||
| $ | id | |||
| ) |
For internal use only.
See documentation for SnapObject::__construct for more on the parameters
Definition at line 52 of file SnapFile.php5.
References populate(), and SnapObject::setSave().
| SnapFile::__call | ( | $ | name, | |
| $ | args | |||
| ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $name | [TYPE]: DESCRIPTION | |
| $args | [TYPE]: DESCRIPTION |
Reimplemented from SnapObject.
Definition at line 1600 of file SnapFile.php5.
| SnapFile::_canChangeMetadata | ( | ) | [protected] |
| SnapFile::_canDelete | ( | ) | [protected] |
| SnapFile::_canDestroy | ( | ) | [protected] |
| SnapFile::_canLinkTo | ( | $ | dest, | |
| $ | shortName = '' | |||
| ) | [protected] |
| SnapFile::_canMove | ( | $ | newParent, | |
| $ | newName = false, |
|||
| $ | removeOldLink = false | |||
| ) | [protected] |
For internal use only.
Definition at line 1048 of file SnapFile.php5.
References Snap2::DELETED_DIR_ID, SnapObject::getId(), SnapObject::getType(), SnapDBI::query(), Snap2::ROOT_DIR_ID, SObject::setError(), and SnapObject::setReason().
| SnapFile::_canRenameAt | ( | $ | parent, | |
| $ | newName = false | |||
| ) | [protected] |
| SnapFile::_canReorderIn | ( | $ | parent, | |
| $ | newOrdinal | |||
| ) | [protected] |
| SnapFile::_canRestore | ( | $ | newParent = '', |
|
| $ | as = '' | |||
| ) | [protected] |
| SnapFile::_canSetCanonicalParent | ( | $ | newParent | ) | [protected] |
For internal use only.
Definition at line 1023 of file SnapFile.php5.
References convertParent(), Snap2::DELETED_DIR_ID, SnapObject::getId(), getPermission(), SnapObject::getType(), isCanonChildOf(), Snap2::ROOT_DIR_ID, and SnapObject::setReason().
| SnapFile::_canUnlinkFrom | ( | $ | src | ) | [protected] |
| SnapFile::addStylesheet | ( | $ | pathOrObj | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $pathOrObj | [TYPE]: DESCRIPTION |
Definition at line 1873 of file SnapFile.php5.
References SnapResource::lookup(), and SnapResource::TYPE_CSS.
| SnapFile::chcanonparent | ( | $ | newParent | ) | [protected] |
For internal use only.
Changes which parent link is considered the canonical (primary) link. The new parent $newParent must be the directory ID of an existing parent link. No new links are created during this operation.
Definition at line 641 of file SnapFile.php5.
References SnapObject::checkValid(), and SObject::setError().
| SnapFile::checkForCycles | ( | $ | potLink | ) | [private] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
| $potLink | [TYPE]: DESCRIPTION |
Definition at line 264 of file SnapFile.php5.
References SnapObject::getId(), and SnapObject::getType().
| SnapFile::chorder | ( | $ | parentId, | |
| $ | newOrdinal | |||
| ) | [protected] |
For internal use only.
Changes the ordinal of this file within the parent given by $parentId. The $newOrdinal must specify the new desired ordinal. There are no special flags to indicate "top" "bottom", "up" or "down". That is implemented in the public API method. All other resources/directories in the specified parent have their ordinals modified to reflect the shuffle.
Definition at line 752 of file SnapFile.php5.
Referenced by reorderIn().
| SnapFile::convertParent | ( | $ | parent | ) | [private] |
For internal use only.
Converts a parent reference into an ID $parent can be: 1) index of parent (just an integer) 2) ID of parent directory (negative of actual ID) 3) path of parent directory 4) parent directory object
Definition at line 833 of file SnapFile.php5.
Referenced by _canSetCanonicalParent().
| SnapFile::delete | ( | ) |
Moves file to /DELETED/ directory.
This is a composite operation. All links to the file are removed, which causes the file to be put in the /DELETED/ directory. The file must have the AdminDirectory/AdminResource permission to be deleted.
Definition at line 1402 of file SnapFile.php5.
| SnapFile::destroy | ( | ) |
Completely deletes file and children.
The file must have already been delete()'ed. To destroy a file, you must have the DESTROY privilege or the ADMIN privilege. If this file is a directory, then all children are unlinked from the directory. If that is the last link for any of the children, then they are deleted (but not destroyed). If the file is a resource, its versions are added to a global list of versions to be destroyed. Once the recursive destroy is complete, these versions are deleted all at once. This way, if the database deletion fails, versions won't have already been deleted, resulting in corruption and loss of data.
Definition at line 1438 of file SnapFile.php5.
References SnapResource::_cancelDestroy(), _canDestroy(), SnapResource::_destroyCMs(), SnapObject::getId(), getParent(), SnapObject::getReason(), rmlink(), and SObject::setError().
| SnapFile::doDestroy | ( | ) | [abstract, protected] |
For internal use only.
Directories and resources need to do different things when destroying themselves.
Reimplemented in SnapDirectory, and SnapResource.
| SnapFile::getAllPaths | ( | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
Definition at line 1793 of file SnapFile.php5.
| SnapFile::getCanonicalShortName | ( | ) |
Retrieves canonical short name of file.
The canonical short name is the name of the link to the canonical parent of the file
Definition at line 1706 of file SnapFile.php5.
Referenced by loadCanonicalPath().
| SnapFile::getOrdinal | ( | $ | parent | ) |
Retrieves ordinal of file with respect to a given parent directory.
The parent can be specified as a path, or a numeric index of the parent (among the list of parents the file has), or a negated directory ID of the parent.
| $parent | [mixed]: which parent directory to get the ordinal for |
Definition at line 1639 of file SnapFile.php5.
| SnapFile::getParent | ( | $ | idx | ) |
Retrieves parent object for specified parent index.
Parents can be described by index. The ordering of the parents is determined by the order they were added in and nothing else. Use ~:getParents% to get a list of parent IDs and indices. Use ~:getCanonicalParent% to get the canonical parent, in preference to using this method to do the same.
| $idx | [integer]: index of parent to retrieve |
Definition at line 1657 of file SnapFile.php5.
References SnapDirectory::retrieve().
| SnapFile::getParentCount | ( | ) |
Retrieves the number of parents this file has.
Definition at line 1695 of file SnapFile.php5.
| SnapFile::getParents | ( | ) |
Retrieves directory IDs of all parents of this file.
Definition at line 1686 of file SnapFile.php5.
Referenced by SnapDirectory::doDestroy().
| SnapFile::getPaths | ( | $ | ref | ) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $ref | [TYPE]: DESCRIPTION |
Definition at line 1836 of file SnapFile.php5.
| SnapFile::getPermission | ( | ) |
Retrieves SnapPermission object for this file.
Each file has one and only one SnapPermission% object associated with it, which is used to query and set permissions for that object. Use this method to get the SnapPermission object. Do NOT try to create a SnapPermission object directly, or bad things may/will happen!
Definition at line 1725 of file SnapFile.php5.
Referenced by SnapResource::_canCreateVersion(), _canSetCanonicalParent(), SnapResource::_canSetValidDate(), and SnapDirectory::canCreateResource().
| SnapFile::getShortName | ( | $ | parent | ) |
Retrieves short name of file with respect to a given parent directory.
The parent can be specified as a path, or a numeric index of the parent (among the list of parents the file has), or a negated directory ID of the parent. Call ~:getCanonicalShortname% to get the canonical short name of the file.
| $parent | [mixed]: which parent directory to get short name for |
Definition at line 1622 of file SnapFile.php5.
| SnapFile::getStylesheets | ( | $ | onlyThis = false |
) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $onlyThis | [TYPE]: DESCRIPTION |
Definition at line 1965 of file SnapFile.php5.
References Snap2::isAdmin(), SnapResource::lookup(), and SnapResource::TYPE_CSS.
| SnapFile::isCanonChildOf | ( | $ | what | ) |
Alias of isChildOf($what, true).
| $what | [mixed]: path or directory ID of ancestor |
Definition at line 1782 of file SnapFile.php5.
Referenced by _canSetCanonicalParent().
| SnapFile::isChildOf | ( | $ | what, | |
| $ | strict = false | |||
| ) |
Determines whether this file is a child of a given directory.
The method name is somewhat of a misnomer. It would be better to say "descendent" instead of "child". This file can be considered a "child" of another directory if it is a immediate child of that directory or one of its parents is considered a "child" of the specified directory. That is, this file must descend from the specified directory. If the $strict parameter is true, then every link followed must be a canonical link. So this file must be the canonical child of the specified directory, or canonical child of a directory which is itself the canonical child of the specified directory, etc.
| $what | [mixed]: path or directory ID to ancestor we are checking to see if this file is a child of | |
| $strict | [boolean]: whether we only consider canonical linkage when determining ancestry |
Definition at line 1744 of file SnapFile.php5.
References Snap2::DELETED_DIR_ID, and Snap2::ROOT_DIR_ID.
| SnapFile::linkTo | ( | $ | dest, | |
| $ | shortName = "" | |||
| ) |
Creates new link to another directory.
Links allow files to be in multiple directories at the same time without having to duplicate the file. This can be useful for grouping files into multiple taxonomies.
When a link is added, no checks are made to see if cycles are introduced. In general, cycles are okay. Care is taken when cascading permissions not to follow cycles. You need the ModDirectory/ModResource permission on this file, and ModDirectory on the destination directory.
| $dest | [mixed]: reference to directory to which the link will be made; the reference can be a path or a directory ID | |
| $shortName | [string]: name of the link; if empty, the canonical short name is used, which is simply the shortname for the link associated with the canonical parent |
Definition at line 1273 of file SnapFile.php5.
| SnapFile::loadCanonicalParent | ( | ) | [protected] |
For internal use only.
Loads the directory representing the canonical parent of this file. Called automatically when an attempt is made to get the canonicalParent field
Definition at line 142 of file SnapFile.php5.
References SnapObject::getId(), SnapObject::getType(), SnapDirectory::retrieve(), and SnapCache::updateById().
| SnapFile::loadCanonicalPath | ( | ) | [protected] |
For internal use only.
Loads the string path associated with the canonical parent. Called automatically when an attempt is made to get the canonicalPath field
Definition at line 156 of file SnapFile.php5.
References Snap2::DELETED_DIR_ID, getCanonicalShortName(), SnapObject::getId(), SnapCache::getPathsById(), SnapObject::getType(), SnapCache::putByPath(), Snap2::ROOT_DIR_ID, SObject::setError(), and SnapCache::updateById().
| SnapFile::loadMetadata | ( | ) | [protected] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
Definition at line 226 of file SnapFile.php5.
References SnapCache::getById(), SnapObject::getId(), SnapObject::getType(), SnapCache::putById(), and SnapCache::updateById().
| SnapFile::loadPermission | ( | ) | [protected] |
For internal use only.
Loads the SnapPermission object for this file. Called automatically when getPermission() is called.
Definition at line 205 of file SnapFile.php5.
References SnapCache::getById(), SnapObject::getId(), SnapObject::getType(), SnapCache::putById(), and SnapCache::updateById().
| static SnapFile::lookup | ( | $ | path | ) | [static] |
Perform path lookup for directory or resource.
This method will interpret the path and retrieve either a directory or a resource, if it can.
| $path | [string]: path to file |
Reimplemented in SnapDirectory, and SnapResource.
Definition at line 1858 of file SnapFile.php5.
References SnapResource::lookup(), and SnapDirectory::lookup().
Referenced by SnapBulkAction::listVersionsRecursive().
| SnapFile::mklink | ( | $ | targetId, | |
| $ | name, | |||
| $ | first = false | |||
| ) | [protected] |
Creates link between this file and a new parent.
For internal use only.
Creates a link between this file and a new parent. The $targetId is the directory ID of the new parent and $name is the short name for the link. $oldParentId should always be 0 unless the link is made into the /DELETED/ directory (when it should be the ID of the old parent directory).
| $targetId | [int]: ID of new directory parent | |
| $name | [string]: shortname for link | |
| $first | [boolean]: if true, disables check to see if link already exists |
Definition at line 294 of file SnapFile.php5.
References SnapObject::checkValid(), SnapObject::getId(), SnapObject::getType(), SObject::setError(), and SnapDBI::startTransaction().
Referenced by SnapDirectory::createDirectory(), SnapDirectory::createResource(), and restore().
| SnapFile::move | ( | $ | newParent, | |
| $ | newName = '', |
|||
| $ | removeOldLink = false | |||
| ) |
Convenience method that "moves" file from one directory to another.
This is a composite operation. It basically creates a new link in the target directory, sets that link as the canonical parent, and optionally removes the old link, creating the effect of moving the file. Moving requires AdminDirectory on both the current parent and the new parent and AdminDirectory/AdminResource on this file.
| $newParent | [mixed]: path to new parent, or directory ID of new parent | |
| $newName | [string]: new short name in destination directory; if empty, will use the current canonical short name. | |
| $removeOldLink | [boolean]: whether to remove the link left behind in the old canonical parent directory |
Definition at line 1364 of file SnapFile.php5.
| SnapFile::populate | ( | ) | [protected] |
For internal use only.
Loads object information, and information about parents and links to those parents. It is called automatically when certain attributes are accessed (dynamic loading)
Reimplemented from SnapObject.
Definition at line 79 of file SnapFile.php5.
References SnapObject::checkValid(), SnapObject::getAttributes(), SnapObject::getId(), SnapObject::getType(), SnapDBI::query(), SObject::setError(), SnapObject::setValid(), and SnapCache::updateById().
Referenced by __construct().
| SnapFile::recReparentPseudoOrphans | ( | $ | parentId | ) | [private] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
| $parentId | [TYPE]: DESCRIPTION |
Definition at line 553 of file SnapFile.php5.
References SnapDBI::cancelTransaction().
| SnapFile::removeStylesheets | ( | $ | which = null |
) |
INSERT BRIEF DESCRIPTION HERE.
INSERT FULL DESCRIPTION HERE
| $which | [TYPE]: DESCRIPTION |
Definition at line 1927 of file SnapFile.php5.
| SnapFile::renameAt | ( | $ | parent, | |
| $ | newName | |||
| ) |
Changes the name of a link.
The link name must be unique within the given parent directory, among both resources and directories. This allows path lookups to actually work. You must also have the ModDirectory/ModResource permission on this file and ModDirectory on the target to change the name of a link.
| $parent | [mixed]: reference to parent to rename link of; the reference may be the path to the parent, the index of the parent in the list of parents, or, if it is a negative integer, the directory ID of the parent (after being negated again). | |
| $newName | [string]: new short name for link |
Definition at line 1319 of file SnapFile.php5.
| SnapFile::renamelink | ( | $ | targetId, | |
| $ | newName | |||
| ) | [protected] |
For internal use only.
Changes the shortname of the link given by $targetId to $newName. Assumes that the new name is alphanumeric with possibly '_' and '-'.
Definition at line 681 of file SnapFile.php5.
| SnapFile::reorderIn | ( | $ | parent, | |
| $ | newOrdinal | |||
| ) |
Change the ordering of the file in a given directory.
Resources and directories can be given arbitrary ordering within a directory. If a file exists in multiple directories, it has a different ordinal for each of those directories that is not affected by its ordinals in other directories. This function requires that you specify the new ordinal of the file, but you can also use one of the four constants: MOVE_UP, MOVE_DOWN, MOVE_TOP, MOVE_BOTTOM to set the ordinal to one less, one greater than what it is, 1 or the current max for the directory, respectively. These constants are members of the SnapFile class, so you must prefix them with SnapFile::. You must have the ModDirectory/ModResource permission on the file and ModDirectory on the parent to reorder the file.
| $parent | [mixed]: parent reference describing which directory to change the order of this file in; can be path to parent, or integer indicating the index of the parent, or a negative integer indicating the parent's ID (negated). | |
| $newOrdinal | [integer]: new ordinal of file in the specified directory, or one of the four constants: MOVE_UP, MOVE_DOWN, MOVE_TOP, MOVE_BOTTOM |
Definition at line 1521 of file SnapFile.php5.
References _canReorderIn(), chorder(), SnapObject::getReason(), and SObject::setError().
| SnapFile::restore | ( | $ | newParent = '', |
|
| $ | newName = '' | |||
| ) |
Restores a deleted file to normal tree.
You must have the RESTORE privilege or the ADMIN privilege to restore a file. By default files are restored to where they were before being deleted, and with the same name. You can pass additional parameters to this method to change where the file is restored to and what its name is, in case, for example, there already is a file with that name in the restoration directory. Note that any links that the file had before being deleted will NOT be restored as these are lost when the file is deleted.
| $newParent | [SnapDirectory]: directory into which to restore the file | |
| $newName | [string]: new short name of file |
Definition at line 1464 of file SnapFile.php5.
References _canRestore(), SnapDBI::cancelTransaction(), SnapDBI::commitTransaction(), SnapObject::getId(), getParent(), SnapObject::getReason(), SnapObject::getType(), mklink(), SnapDBI::query(), rmlink(), SObject::setError(), SnapDBI::startTransaction(), and SnapCache::updateById().
| SnapFile::rmlink | ( | $ | targetId | ) | [protected] |
For internal use only.
Removes a link to a parent specified by $targetId. If it was the last link for this file, then the file is moved to /DELETED/. If it already was in /DELETED/, then a destroy operation commences and the object is removed from the database altogether. If the link was to the current canonical parent, then the canonical parent is changed to the first remaining link.
Definition at line 386 of file SnapFile.php5.
| SnapFile::setCanonicalParent | ( | $ | newParent | ) |
Changes which link is considered the canonical (primary) link.
The canonical link/parent is used when generate paths and canonical shortnames. It does not have any relevance for permission cascades, or anything else. You must have AdminDirectory on both the new and old parent, and AdminDirectory/AdminResource on this file. The new parent must be an existing link.
| $newParent | [mixed]: reference to parent to become new canonical parent; the reference may be the path to the parent, or the index of the parent in the list of parents, or, if it is a negative integer, the directory ID of the parent (after being negated again). |
Definition at line 1341 of file SnapFile.php5.
| SnapFile::setCanonicalShortName | ( | $ | csn | ) | [protected] |
INSERT BRIEF DESCRIPTION HERE.
For internal use only.
INSERT FULL DESCRIPTION HERE
| $csn | [TYPE]: DESCRIPTION |
Definition at line 248 of file SnapFile.php5.
| SnapFile::setDescription | ( | $ | newDesc | ) |
Changes the description of the file.
You must have the ModDirectory/ModResource permission on this file to change its description.
| $newDesc | [string]: new description of the file |
Definition at line 1566 of file SnapFile.php5.
| SnapFile::setName | ( | $ | newName | ) |
Changes the "long" name of the file.
You must have the ModDirectory/ModResource permission on this file to change its name.
| $newName | [string]: new "long" name of the file |
Definition at line 1538 of file SnapFile.php5.
References _canChangeMetadata(), SnapObject::getReason(), SnapObject::getType(), SObject::setError(), and SnapDBI::startTransaction().
| SnapFile::unlinkFrom | ( | $ | src | ) |
Removes existing link to this file.
If this is the last link to the file, the operation will abort. Use delete() instead. If the link is to the canonical parent, then the canonical parent will be changed to be the first remaining link. You must have AdminDirectory permission on the new canonical parent, or the operation will abort as well. In all cases, you need AdminDirectory on the parent and AdminDirectory/AdminResource on this file to perform the operation.
| $src | [mixed]: reference to parent to remove link from; the reference may be the path to the parent, or the index of the parent in the list of parents. If the reference is negative it is treated as the directory ID of the parent (after being negated again). |
Definition at line 1297 of file SnapFile.php5.
1.5.6