@@ -160,18 +160,6 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
|
||||
public function load($ids = array(), $conditions = array()) {
|
||||
$entities = array();
|
||||
|
||||
# PATCH http://drupal.org/node/1003788#comment-5195682
|
||||
// Clean the $ids array to remove non-integer values that can be passed
|
||||
// in from various sources, including menu callbacks.
|
||||
if (is_array($ids)) {
|
||||
foreach ($ids as $key => $id) {
|
||||
if (empty($id) || ((string) $id !== (string) (int) $id)) {
|
||||
unset($ids[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
# endpatch
|
||||
|
||||
// Revisions are not statically cached, and require a different query to
|
||||
// other conditions, so separate the revision id into its own variable.
|
||||
if ($this->revisionKey && isset($conditions[$this->revisionKey])) {
|
||||
@@ -308,6 +296,7 @@ class DrupalDefaultEntityController implements DrupalEntityControllerInterface {
|
||||
|
||||
/**
|
||||
* Attaches data to entities upon loading.
|
||||
*
|
||||
* This will attach fields, if the entity is fieldable. It calls
|
||||
* hook_entity_load() for modules which need to add data to all entities.
|
||||
* It also calls hook_TYPE_load() on the loaded entities. For example
|
||||
@@ -427,13 +416,14 @@ class EntityFieldQueryException extends Exception {}
|
||||
* an EntityFieldQueryException will be raised if an unsupported condition is
|
||||
* specified or if the query has field conditions or sorts that are stored in
|
||||
* different field storage engines. However, this logic can be overridden in
|
||||
* hook_entity_query().
|
||||
* hook_entity_query_alter().
|
||||
*
|
||||
* Also note that this query does not automatically respect entity access
|
||||
* restrictions. Node access control is performed by the SQL storage engine but
|
||||
* other storage engines might not do this.
|
||||
*/
|
||||
class EntityFieldQuery {
|
||||
|
||||
/**
|
||||
* Indicates that both deleted and non-deleted fields should be returned.
|
||||
*
|
||||
@@ -606,9 +596,7 @@ class EntityFieldQuery {
|
||||
*
|
||||
* 'bundle', 'revision_id' and 'entity_id' have no such restrictions.
|
||||
*
|
||||
* Note: The "comment" and "taxonomy_term" entity types don't support bundle
|
||||
* conditions. For "taxonomy_term", propertyCondition('vid') can be used
|
||||
* instead.
|
||||
* Note: The "comment" entity type does not support bundle conditions.
|
||||
*
|
||||
* @param $name
|
||||
* 'entity_type', 'bundle', 'revision_id' or 'entity_id'.
|
||||
@@ -970,7 +958,7 @@ class EntityFieldQuery {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable a pager for the query.
|
||||
* Enables a pager for the query.
|
||||
*
|
||||
* @param $limit
|
||||
* An integer specifying the number of elements per page. If passed a false
|
||||
@@ -998,10 +986,11 @@ class EntityFieldQuery {
|
||||
}
|
||||
|
||||
/**
|
||||
* Enable sortable tables for this query.
|
||||
* Enables sortable tables for this query.
|
||||
*
|
||||
* @param $headers
|
||||
* An EFQ Header array based on which the order clause is added to the query.
|
||||
* An EFQ Header array based on which the order clause is added to the
|
||||
* query.
|
||||
*
|
||||
* @return EntityFieldQuery
|
||||
* The called object.
|
||||
@@ -1284,7 +1273,7 @@ class EntityFieldQuery {
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the total number of results and initialize a pager for the query.
|
||||
* Gets the total number of results and initializes a pager for the query.
|
||||
*
|
||||
* The pager can be disabled by either setting the pager limit to 0, or by
|
||||
* setting this query to be a count query.
|
||||
@@ -1371,6 +1360,6 @@ class EntityFieldQuery {
|
||||
}
|
||||
|
||||
/**
|
||||
* Exception thrown when a malformed entity is passed.
|
||||
* Defines an exception thrown when a malformed entity is passed.
|
||||
*/
|
||||
class EntityMalformedException extends Exception { }
|
||||
|
||||
Reference in New Issue
Block a user