Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
drupal
Commits
25713f0b
Commit
25713f0b
authored
May 17, 2012
by
Nathaniel Catchpole
Browse files
Issue
#1495024
by aspilicious: documentation follow-up for convert the entity system to
PSR-0
.
parent
c1763702
Changes
6
Hide whitespace changes
Inline
Side-by-side
core/modules/comment/lib/Drupal/comment/Comment.php
View file @
25713f0b
...
...
@@ -78,14 +78,14 @@ class Comment extends Entity {
public
$homepage
;
/**
* Implements EntityInterface::id().
* Implements
Drupal\entity\
EntityInterface::id().
*/
public
function
id
()
{
return
$this
->
cid
;
}
/**
* Implements EntityInterface::bundle().
* Implements
Drupal\entity\
EntityInterface::bundle().
*/
public
function
bundle
()
{
return
$this
->
node_type
;
...
...
core/modules/comment/lib/Drupal/comment/CommentStorageController.php
View file @
25713f0b
...
...
@@ -13,13 +13,13 @@
/**
* Defines the controller class for comments.
*
* This extends the EntityDatabaseStorageController class, adding
required
* special handling for comment entities.
* This extends the
Drupal\entity\
EntityDatabaseStorageController class, adding
*
required
special handling for comment entities.
*/
class
CommentStorageController
extends
EntityDatabaseStorageController
{
/**
* Overrides EntityDatabaseStorageController::buildQuery().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::buildQuery().
*/
protected
function
buildQuery
(
$ids
,
$conditions
=
array
(),
$revision_id
=
FALSE
)
{
$query
=
parent
::
buildQuery
(
$ids
,
$conditions
,
$revision_id
);
...
...
@@ -33,7 +33,7 @@ protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE)
}
/**
* Overrides EntityDatabaseStorageController::attachLoad().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::attachLoad().
*/
protected
function
attachLoad
(
&
$comments
,
$revision_id
=
FALSE
)
{
// Set up standard comment properties.
...
...
@@ -47,7 +47,7 @@ protected function attachLoad(&$comments, $revision_id = FALSE) {
}
/**
* Overrides EntityDatabaseStorageController::preSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::preSave().
*
* @see comment_int_to_alphadecimal()
* @see comment_increment_alphadecimal()
...
...
@@ -129,7 +129,7 @@ protected function preSave(EntityInterface $comment) {
}
/**
* Overrides EntityDatabaseStorageController::postSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::postSave().
*/
protected
function
postSave
(
EntityInterface
$comment
,
$update
)
{
// Update the {node_comment_statistics} table prior to executing the hook.
...
...
@@ -140,7 +140,7 @@ protected function postSave(EntityInterface $comment, $update) {
}
/**
* Overrides EntityDatabaseStorageController::postDelete().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::postDelete().
*/
protected
function
postDelete
(
$comments
)
{
// Delete the comments' replies.
...
...
core/modules/node/lib/Drupal/node/Node.php
View file @
25713f0b
...
...
@@ -145,21 +145,21 @@ class Node extends Entity {
public
$revision_uid
;
/**
* Implements EntityInterface::id().
* Implements
Drupal\entity\
EntityInterface::id().
*/
public
function
id
()
{
return
$this
->
nid
;
}
/**
* Implements EntityInterface::bundle().
* Implements
Drupal\entity\
EntityInterface::bundle().
*/
public
function
bundle
()
{
return
$this
->
type
;
}
/**
* Overrides Entity::createDuplicate().
* Overrides
Drupal\entity\
Entity::createDuplicate().
*/
public
function
createDuplicate
()
{
$duplicate
=
clone
$this
;
...
...
core/modules/node/lib/Drupal/node/NodeStorageController.php
View file @
25713f0b
...
...
@@ -15,13 +15,13 @@
/**
* Controller class for nodes.
*
* This extends the EntityDatabaseStorageController class, adding
required
* special handling for node entities.
* This extends the
Drupal\entity\
EntityDatabaseStorageController class, adding
*
required
special handling for node entities.
*/
class
NodeStorageController
extends
EntityDatabaseStorageController
{
/**
* Overrides EntityDatabaseStorageController::create().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::create().
*/
public
function
create
(
array
$values
)
{
$node
=
parent
::
create
(
$values
);
...
...
@@ -35,7 +35,7 @@ public function create(array $values) {
}
/**
* Overrides EntityDatabaseStorageController::delete().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::delete().
*/
public
function
delete
(
$ids
)
{
$entities
=
$ids
?
$this
->
load
(
$ids
)
:
FALSE
;
...
...
@@ -80,7 +80,7 @@ public function delete($ids) {
}
/**
* Overrides EntityDatabaseStorageController::save().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::save().
*/
public
function
save
(
EntityInterface
$entity
)
{
$transaction
=
db_transaction
();
...
...
@@ -192,7 +192,7 @@ protected function buildQuery($ids, $conditions = array(), $revision_id = FALSE)
}
/**
* Overrides EntityDatabaseStorageController::invokeHook().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::invokeHook().
*/
protected
function
invokeHook
(
$hook
,
EntityInterface
$node
)
{
if
(
$hook
==
'insert'
||
$hook
==
'update'
)
{
...
...
@@ -241,7 +241,7 @@ protected function invokeHook($hook, EntityInterface $node) {
}
/**
* Overrides EntityDatabaseStorageController::preSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::preSave().
*/
protected
function
preSave
(
EntityInterface
$node
)
{
// Before saving the node, set changed and revision times.
...
...
@@ -257,14 +257,14 @@ protected function preSave(EntityInterface $node) {
}
/**
* Overrides EntityDatabaseStorageController::postSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::postSave().
*/
function
postSave
(
EntityInterface
$node
,
$update
)
{
node_access_acquire_grants
(
$node
,
$update
);
}
/**
* Overrides EntityDatabaseStorageController::preDelete().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::preDelete().
*/
function
preDelete
(
$entities
)
{
if
(
module_exists
(
'search'
))
{
...
...
@@ -275,7 +275,7 @@ function preDelete($entities) {
}
/**
* Overrides EntityDatabaseStorageController::postDelete().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::postDelete().
*/
protected
function
postDelete
(
$nodes
)
{
// Delete values from other tables also referencing this node.
...
...
core/modules/user/lib/Drupal/user/User.php
View file @
25713f0b
...
...
@@ -136,7 +136,7 @@ class User extends Entity {
public
$roles
=
array
();
/**
* Implements EntityInterface::id().
* Implements
Drupal\entity\
EntityInterface::id().
*/
public
function
id
()
{
return
$this
->
uid
;
...
...
core/modules/user/lib/Drupal/user/UserStorageController.php
View file @
25713f0b
...
...
@@ -14,13 +14,13 @@
/**
* Controller class for users.
*
* This extends the EntityDatabaseStorageController class, adding
required
* special handling for user objects.
* This extends the
Drupal\entity\
EntityDatabaseStorageController class, adding
*
required
special handling for user objects.
*/
class
UserStorageController
extends
EntityDatabaseStorageController
{
/**
* Overrides EntityDatabaseStorageController::attachLoad().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::attachLoad().
*/
function
attachLoad
(
&
$queried_users
,
$revision_id
=
FALSE
)
{
// Build an array of user picture IDs so that these can be fetched later.
...
...
@@ -60,7 +60,7 @@ function attachLoad(&$queried_users, $revision_id = FALSE) {
}
/**
* Overrides EntityDatabaseStorageController::create().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::create().
*/
public
function
create
(
array
$values
)
{
if
(
!
isset
(
$values
[
'created'
]))
{
...
...
@@ -73,7 +73,7 @@ public function create(array $values) {
}
/**
* Overrides EntityDatabaseStorageController::save().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::save().
*/
public
function
save
(
EntityInterface
$entity
)
{
if
(
empty
(
$entity
->
uid
))
{
...
...
@@ -84,7 +84,7 @@ public function save(EntityInterface $entity) {
}
/**
* Overrides EntityDatabaseStorageController::preSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::preSave().
*/
protected
function
preSave
(
EntityInterface
$entity
)
{
// Update the user password if it has changed.
...
...
@@ -159,7 +159,7 @@ protected function preSave(EntityInterface $entity) {
}
/**
* Overrides EntityDatabaseStorageController::postSave().
* Overrides
Drupal\entity\
EntityDatabaseStorageController::postSave().
*/
protected
function
postSave
(
EntityInterface
$entity
,
$update
)
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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