1
0
mirror of https://github.com/processwire/processwire.git synced 2025-08-13 02:04:35 +02:00

Add support for feature requested in processwire/processwire-issues#1208

This commit is contained in:
Ryan Cramer
2020-07-23 15:58:55 -04:00
parent fe32580027
commit 9f368febfc
2 changed files with 21 additions and 1 deletions

View File

@@ -711,6 +711,22 @@ class Field extends WireData implements Saveable, Exportable {
return $fieldgroup->getFieldContext($this->id, $namespace);
}
/**
* Does this field have context settings for given Page/Template?
*
* #pw-group-retrieval
*
* @param Page|Template|Fieldgroup|string $for Specify Page, Template, or template name string
* @param string $namespace Optional namespace (internal use)
* @return Field|bool
* @since 3.0.163
* @see Field::getContext()
*
*/
public function hasContext($for, $namespace = '') {
return $this->getContext($for, $namespace, true);
}
/**
* Set the roles that are allowed to view or edit this field on pages.
*