summaryrefslogtreecommitdiff
path: root/library
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@gmail.com>2014-10-05 23:04:02 +0100
committerGreg Roach <fisharebest@gmail.com>2014-10-05 23:04:02 +0100
commit78d880c301354133a9cea67772d761cce64fabd1 (patch)
treec597683da0a36147927b40b1dea6dea38423bce5 /library
parente5a693f8de2b2578ee13740b4382f8c4e666f00a (diff)
downloadwebtrees-78d880c301354133a9cea67772d761cce64fabd1.tar.gz
webtrees-78d880c301354133a9cea67772d761cce64fabd1.tar.bz2
webtrees-78d880c301354133a9cea67772d761cce64fabd1.zip
PHPDoc
Diffstat (limited to 'library')
-rw-r--r--library/WT/I18N.php2
-rw-r--r--library/WT/Tree.php55
2 files changed, 47 insertions, 10 deletions
diff --git a/library/WT/I18N.php b/library/WT/I18N.php
index c72c516aee..88058c3ae5 100644
--- a/library/WT/I18N.php
+++ b/library/WT/I18N.php
@@ -403,7 +403,7 @@ class WT_I18N {
* This is necessary to fetch a format string (containing % characters) without
* performing sustitution of arguments.
*
- * @param string,... $string, $args...
+ * @param string $string
*
* @return string
*/
diff --git a/library/WT/Tree.php b/library/WT/Tree.php
index 342b8d5a8a..1f297c3258 100644
--- a/library/WT/Tree.php
+++ b/library/WT/Tree.php
@@ -162,7 +162,11 @@ class WT_Tree {
return Auth::isModerator($this, $user);
}
- // Fetch all the trees that we have permission to access.
+ /**
+ * Fetch all the trees that we have permission to access.
+ *
+ * @return WT_Tree[]
+ */
public static function getAll() {
if (self::$trees === null) {
self::$trees = array();
@@ -177,7 +181,7 @@ class WT_Tree {
" g.gedcom_id>0 AND (". // exclude the "template" tree
" EXISTS (SELECT 1 FROM `##user_setting` WHERE user_id=? AND setting_name='canadmin' AND setting_value=1)" . // Admin sees all
" ) OR (" .
- " gs2.setting_value = 1 AND (". // Allow imported trees, with either:
+ " gs2.setting_value = 1 AND (". // Allow imported trees, with either:
" gs3.setting_value <> 1 OR" . // visitor access
" IFNULL(ugs.setting_value, 'none')<>'none'" . // explicit access
" )" .
@@ -192,16 +196,26 @@ class WT_Tree {
return self::$trees;
}
- // Get the tree with a specific ID. TODO - is this function needed long-term, or just while
- // we integrate this class into the rest of the code?
+ /**
+ * Get the tree with a specific ID. TODO - is this function needed long-term, or just while
+ * we integrate this class into the rest of the code?
+ *
+ * @param int $tree_id
+ *
+ * @return WT_Tree
+ */
public static function get($tree_id) {
$trees = self::getAll();
return $trees[$tree_id];
}
- // Create arguments to select_edit_control()
- // Note - these will be escaped later
+ /**
+ * Create arguments to select_edit_control()
+ * Note - these will be escaped later
+ *
+ * @return string[]
+ */
public static function getIdList() {
$list = array();
foreach (self::getAll() as $tree) {
@@ -211,8 +225,12 @@ class WT_Tree {
return $list;
}
- // Create arguments to select_edit_control()
- // Note - these will be escaped later
+ /**
+ * Create arguments to select_edit_control()
+ * Note - these will be escaped later
+ *
+ * @return string[]
+ */
public static function getNameList() {
$list = array();
foreach (self::getAll() as $tree) {
@@ -222,6 +240,13 @@ class WT_Tree {
return $list;
}
+ /**
+ * Find the ID number for a tree name
+ *
+ * @param int $tree_name
+ *
+ * @return int|null
+ */
public static function getIdFromName($tree_name) {
foreach (self::getAll() as $tree_id => $tree) {
if ($tree->tree_name == $tree_name) {
@@ -232,11 +257,23 @@ class WT_Tree {
return null;
}
+ /**
+ * Find the tree name from a numeric ID.
+ * @param int $tree_id
+ *
+ * @return string
+ */
public static function getNameFromId($tree_id) {
return self::get($tree_id)->tree_name;
}
- // Create a new tree
+ /**
+ * Create a new tree
+ *
+ * @param string $tree_name
+ *
+ * @return void
+ */
public static function create($tree_name) {
try {
// Create a new tree