mirror of
https://github.com/processwire/processwire.git
synced 2025-08-10 16:54:44 +02:00
Phpdoc improvements to various core classes
This commit is contained in:
@@ -18,6 +18,8 @@
|
|||||||
*
|
*
|
||||||
* @property int $id Fieldgroup database ID #pw-group-retrieval
|
* @property int $id Fieldgroup database ID #pw-group-retrieval
|
||||||
* @property string $name Fieldgroup name #pw-group-retrieval
|
* @property string $name Fieldgroup name #pw-group-retrieval
|
||||||
|
* @property array $fields_id Array of all field IDs in this Fieldgroup
|
||||||
|
* @property null|FieldsArray $removedFields Null when there are no removed fields, or FieldsArray when there are.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
class Fieldgroup extends WireArray implements Saveable, Exportable, HasLookupItems {
|
class Fieldgroup extends WireArray implements Saveable, Exportable, HasLookupItems {
|
||||||
@@ -335,7 +337,7 @@ class Fieldgroup extends WireArray implements Saveable, Exportable, HasLookupIte
|
|||||||
* #pw-group-retrieval
|
* #pw-group-retrieval
|
||||||
*
|
*
|
||||||
* @param string|int $key Property name to retrieve, or Field name
|
* @param string|int $key Property name to retrieve, or Field name
|
||||||
* @return Field|string|int|null
|
* @return Field|string|int|null|array
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function get($key) {
|
public function get($key) {
|
||||||
|
@@ -3,7 +3,9 @@
|
|||||||
/**
|
/**
|
||||||
* ProcessWire Fieldgroups
|
* ProcessWire Fieldgroups
|
||||||
*
|
*
|
||||||
* Maintains collections of Fieldgroup instances.
|
* #pw-summary Maintains collections of Fieldgroup object instances and represents the `$fieldgroups` API variable.
|
||||||
|
* #pw-body For full details on all methods available in a Fieldgroup, be sure to also see the `WireArray` class.
|
||||||
|
* #pw-var $fieldgroups
|
||||||
*
|
*
|
||||||
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2016 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
@@ -466,13 +468,13 @@ class Fieldgroups extends WireSaveableItemsLookup {
|
|||||||
|
|
||||||
if(($field->flags & Field::flagGlobal) && (!$template || !$template->noGlobal)) {
|
if(($field->flags & Field::flagGlobal) && (!$template || !$template->noGlobal)) {
|
||||||
return
|
return
|
||||||
"Field '$field' may not be removed from fieldgroup '{$this->name}' " .
|
"Field '$field' may not be removed from fieldgroup '$fieldgroup->name' " .
|
||||||
"because it is globally required (Field::flagGlobal).";
|
"because it is globally required (Field::flagGlobal).";
|
||||||
}
|
}
|
||||||
|
|
||||||
if($field->flags & Field::flagPermanent) {
|
if($field->flags & Field::flagPermanent) {
|
||||||
return
|
return
|
||||||
"Field '$field' may not be removed from fieldgroup '{$this->name}' " .
|
"Field '$field' may not be removed from fieldgroup '$fieldgroup->name' " .
|
||||||
"because it is permanent (Field::flagPermanent).";
|
"because it is permanent (Field::flagPermanent).";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,16 @@
|
|||||||
* ProcessWire 3.x, Copyright 2018 by Ryan Cramer
|
* ProcessWire 3.x, Copyright 2018 by Ryan Cramer
|
||||||
* https://processwire.com
|
* https://processwire.com
|
||||||
*
|
*
|
||||||
* #pw-summary Manages all custom fields in ProcessWire
|
* #pw-summary Manages all custom fields in ProcessWire, independently of any Fieldgroup.
|
||||||
|
* #pw-var $fields
|
||||||
|
* #pw-body =
|
||||||
|
* Each field returned is an object of type `Field`. The $fields API variable is iterable:
|
||||||
|
* ~~~~~
|
||||||
|
* foreach($fields as $field) {
|
||||||
|
* echo "<p>Name: $field->name, Type: $field->type, Label: $field->label</p>";
|
||||||
|
* }
|
||||||
|
* ~~~~~
|
||||||
|
* #pw-body
|
||||||
*
|
*
|
||||||
* @method Field|null get($key) Get a field by name or id
|
* @method Field|null get($key) Get a field by name or id
|
||||||
* @method bool changeFieldtype(Field $field1, $keepSettings = false)
|
* @method bool changeFieldtype(Field $field1, $keepSettings = false)
|
||||||
@@ -309,7 +318,6 @@ class Fields extends WireSaveableItems {
|
|||||||
* @param Field|Saveable $item Field to clone
|
* @param Field|Saveable $item Field to clone
|
||||||
* @param string $name Optionally specify name for new cloned item
|
* @param string $name Optionally specify name for new cloned item
|
||||||
* @return bool|Saveable $item Returns the new clone on success, or false on failure
|
* @return bool|Saveable $item Returns the new clone on success, or false on failure
|
||||||
* @throws WireException
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function ___clone(Saveable $item, $name = '') {
|
public function ___clone(Saveable $item, $name = '') {
|
||||||
|
@@ -531,6 +531,7 @@ abstract class Inputfield extends WireData implements Module {
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public function getParents() {
|
public function getParents() {
|
||||||
|
/** @var InputfieldWrapper|null $parent */
|
||||||
$parent = $this->getParent();
|
$parent = $this->getParent();
|
||||||
if(!$parent) return array();
|
if(!$parent) return array();
|
||||||
$parents = array($parent);
|
$parents = array($parent);
|
||||||
|
@@ -22,7 +22,7 @@
|
|||||||
* @property-read string $filename full disk path to the file on the server.
|
* @property-read string $filename full disk path to the file on the server.
|
||||||
* @property-read string $name Returns the filename without the path, same as the "basename" property.
|
* @property-read string $name Returns the filename without the path, same as the "basename" property.
|
||||||
* @property-read string $hash Get a unique hash (for the page) representing this Pagefile.
|
* @property-read string $hash Get a unique hash (for the page) representing this Pagefile.
|
||||||
* @property-read string $tagsArray Get file tags as an array. #pw-group-tags @since 3.0.17
|
* @property-read array $tagsArray Get file tags as an array. #pw-group-tags @since 3.0.17
|
||||||
* @property int $sort Sort order in database. #pw-group-other
|
* @property int $sort Sort order in database. #pw-group-other
|
||||||
* @property string $basename Returns the filename without the path.
|
* @property string $basename Returns the filename without the path.
|
||||||
* @property string $description Value of the file’s description field (string), if enabled. Note you can also set this property directly.
|
* @property string $description Value of the file’s description field (string), if enabled. Note you can also set this property directly.
|
||||||
|
Reference in New Issue
Block a user