You are here

function flag_flag::remember_entity in Flag 7.3

Store an object in the flag handler's cache.

This is needed because otherwise fetch_object() loads the object from the database (by calling _load_entity()), whereas sometimes we want to fetch an object that hasn't yet been saved to the database. Subsequent calls to fetch_entity() return the remembered object.

Parameters

int $entity_id: The ID of the object to cache.

stdClass $object: The object to cache.

1 call to flag_flag::remember_entity()
flag_comment::get_entity_id in includes/flag/flag_comment.inc
Returns the entity id, if it already exists.

File

includes/flag/flag_flag.inc, line 378
Contains the flag_flag class. Flag type classes use an object oriented style inspired by that of Views 2.

Class

flag_flag
This abstract class represents a flag, or, in Views 2 terminology, "a handler".

Code

function remember_entity($entity_id, $object) {
  $this
    ->fetch_entity($entity_id, $object);
}