Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
D
drupal
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Custom Issue Tracker
Custom Issue Tracker
Labels
Merge Requests
229
Merge Requests
229
Requirements
Requirements
List
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Analytics
Analytics
Code Review
Insights
Issue
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
project
drupal
Commits
89773d1a
Commit
89773d1a
authored
Oct 17, 2013
by
webchick
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue
#2092265
by andypost, Xano, amateescu: Fix type-hinting for FieldInfo methods.
parent
c3924101
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
31 deletions
+30
-31
core/modules/field/lib/Drupal/field/FieldInfo.php
core/modules/field/lib/Drupal/field/FieldInfo.php
+30
-31
No files found.
core/modules/field/lib/Drupal/field/FieldInfo.php
View file @
89773d1a
...
...
@@ -71,7 +71,7 @@ class FieldInfo {
/**
* List of $field structures keyed by ID. Includes deleted fields.
*
* @var
array
* @var
\Drupal\field\FieldInterface[]
*/
protected
$fieldsById
=
array
();
...
...
@@ -166,7 +166,7 @@ public function flush() {
/**
* Collects a lightweight map of fields across bundles.
*
* @return
* @return
array
* An array keyed by entity type. Each value is an array which keys are
* field names and value is an array with two entries:
* - type: The field type.
...
...
@@ -218,8 +218,8 @@ public function getFieldMap() {
/**
* Returns all active fields, including deleted ones.
*
* @return
* An array of field
definition
s, keyed by field ID.
* @return
\Drupal\field\FieldInterface[]
* An array of field
entitie
s, keyed by field ID.
*/
public
function
getFields
()
{
// Read from the "static" cache.
...
...
@@ -256,10 +256,10 @@ public function getFields() {
/**
* Retrieves all active, non-deleted instances definitions.
*
* @param $entity_type
* @param
string
$entity_type
* (optional) The entity type.
*
* @return
* @return
array
* If $entity_type is not set, all instances keyed by entity type and bundle
* name. If $entity_type is set, all instances for that entity type, keyed
* by bundle name.
...
...
@@ -309,7 +309,7 @@ public function getInstances($entity_type = NULL) {
* @param string $field_name
* The field name.
*
* @return
* @return
\Drupal\field\FieldInterface|null
* The field definition, or NULL if no field was found.
*/
public
function
getField
(
$entity_type
,
$field_name
)
{
...
...
@@ -340,15 +340,15 @@ public function getField($entity_type, $field_name) {
}
/**
* Returns a field
definition
from a field ID.
* Returns a field
entity
from a field ID.
*
* This method only retrieves active fields, deleted or not.
*
* @param $field_id
* @param
string
$field_id
* The field ID.
*
* @return
* The field
definition
, or NULL if no field was found.
* @return
\Drupal\field\FieldInterface|null
* The field
entity
, or NULL if no field was found.
*/
public
function
getFieldById
(
$field_id
)
{
// Read from the "static" cache.
...
...
@@ -386,13 +386,13 @@ public function getFieldById($field_id) {
* The function also populates the corresponding field definitions in the
* "static" cache.
*
* @param $entity_type
* @param
string
$entity_type
* The entity type.
* @param $bundle
* @param
string
$bundle
* The bundle name.
*
* @return
*
The array of instance definition
s, keyed by field name.
* @return
\Drupal\field\FieldInstanceInterface[]
*
An array of field instance entitie
s, keyed by field name.
*/
public
function
getBundleInstances
(
$entity_type
,
$bundle
)
{
// Read from the "static" cache.
...
...
@@ -496,7 +496,7 @@ public function getBundleInstances($entity_type, $bundle) {
}
/**
* Returns a
n array of instance data for a specific field and bundl
e.
* Returns a
field instanc
e.
*
* @param string $entity_type
* The entity type for the instance.
...
...
@@ -505,9 +505,8 @@ public function getBundleInstances($entity_type, $bundle) {
* @param string $field_name
* The field name for the instance.
*
* @return array
* An associative array of instance data for the specific field and bundle;
* NULL if the instance does not exist.
* @return \Drupal\field\FieldInstanceInterface|null
* The field instance entity, or NULL if it does not exist.
*/
function
getInstance
(
$entity_type
,
$bundle
,
$field_name
)
{
$info
=
$this
->
getBundleInstances
(
$entity_type
,
$bundle
);
...
...
@@ -519,12 +518,12 @@ function getInstance($entity_type, $bundle, $field_name) {
/**
* Retrieves the "extra fields" for a bundle.
*
* @param $entity_type
* @param
string
$entity_type
* The entity type.
* @param $bundle
* @param
string
$bundle
* The bundle name.
*
* @return
* @return
array
* The array of extra fields.
*/
public
function
getBundleExtraFields
(
$entity_type
,
$bundle
)
{
...
...
@@ -555,13 +554,13 @@ public function getBundleExtraFields($entity_type, $bundle) {
}
/**
* Prepares a field
definition
for the current run-time context.
* Prepares a field for the current run-time context.
*
* @param $field
* The
raw field structure as read from the databas
e.
* @param
\Drupal\field\FieldInterface
$field
* The
field entity to updat
e.
*
* @return
* The field
definition completed for the current runtime context
.
* @return
\Drupal\field\FieldInterface
* The field
that was prepared
.
*/
public
function
prepareField
(
FieldInterface
$field
)
{
// Make sure all expected field settings are present.
...
...
@@ -571,13 +570,13 @@ public function prepareField(FieldInterface $field) {
}
/**
* Prepares a
n instance definition
for the current run-time context.
* Prepares a
field instance
for the current run-time context.
*
* @param \Drupal\field\FieldInstanceInterface $instance
* The
instance definition
.
* The
field instance entity to prepare
.
*
* @return
* The field instance
array completed for the current runtime context
.
* @return
\Drupal\field\FieldInstanceInterface
* The field instance
that was prepared
.
*/
public
function
prepareInstance
(
FieldInstanceInterface
$instance
)
{
// Make sure all expected instance settings are present.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment