public function set($entity, $entity_id, $created, $user_id = null)
    {
        if (!isset($user_id)) {
            $user_id = $this->user->getId(); // Current user
        }

        if ($this->exists($entity, $entity_id, $user_id)) {
            return true;
        }

        if ((GC_TIME - $created) >= $this->getLifespan()) {
            return true; // Expired and was removed
        }

        $data = array(
            'entity' => $entity,
            'user_id' => $user_id,
            'entity_id' => $entity_id
        );

        return $this->add($data);
    }
public function set($entity, $entity_id, $created, $user_id = null)
    {
        if (!isset($user_id)) {
            $user_id = $this->user->getId(); // Current user
        }

        if ($this->exists($entity, $entity_id, $user_id)) {
            return true;
        }

        if ((GC_TIME - $created) >= $this->getLifespan()) {
            return true; // Expired and was removed
        }

        $data = array(
            'entity' => $entity,
            'user_id' => $user_id,
            'entity_id' => $entity_id
        );

        return $this->add($data);
    }
public function set ( $ entity , $ entity_id , $ created , $ user_id = null ) { if ( ! isset ( $ user_id ) ) { $ user_id = $ this -> user -> getId ( ) ; // Current user } if ( $ this -> exists ( $ entity , $ entity_id , $ user_id ) ) { return true ; } if ( ( GC_TIME - $ created ) >= $ this -> getLifespan ( ) ) { return true ; // Expired and was removed } $ data = array ( 'entity' => $ entity , 'user_id' => $ user_id , 'entity_id' => $ entity_id ) ; return $ this -> add ( $ data ) ; }
Set a history record
@param string $entity
@param int $entity_id
@param int $created
@param null|int $user_id
@return boolean
Set a history record