src/Rails/ActiveRecord/Persistence/PersistedModel/Methods/PersistenceMethodsTrait.php
public function recover()
    {
        if (!$this->isRecoverable()) {
            throw new Exception\BadMethodCallException(
                sprintf(
                    "Object of class %s isn't recoverable",
                    get_class($this)
                )
            );
        }
        
        if ($this->isDeleted()) {
            $this->runCallbacks('recover', function() {
                $this->directUpdate(static::deletedAtAttribute(), static::deletedAtEmptyValue());
                $this->reload();
            });
        }
        
        return true;
    }
public function recover()
    {
        if (!$this->isRecoverable()) {
            throw new Exception\BadMethodCallException(
                sprintf(
                    "Object of class %s isn't recoverable",
                    get_class($this)
                )
            );
        }
        
        if ($this->isDeleted()) {
            $this->runCallbacks('recover', function() {
                $this->directUpdate(static::deletedAtAttribute(), static::deletedAtEmptyValue());
                $this->reload();
            });
        }
        
        return true;
    }
public function recover ( ) { if ( ! $ this -> isRecoverable ( ) ) { throw new Exception \ BadMethodCallException ( sprintf ( "Object of class %s isn't recoverable" , get_class ( $ this ) ) ) ; } if ( $ this -> isDeleted ( ) ) { $ this -> runCallbacks ( 'recover' , function ( ) { $ this -> directUpdate ( static :: deletedAtAttribute ( ) , static :: deletedAtEmptyValue ( ) ) ; $ this -> reload ( ) ; } ) ; } return true ; }
Recovers a deleted object by setting the DELETED_AT_ATTRIBUTE to null.
If the object is not deleted, no action is taken.
If the object isn't recoverable, however, an exception is thrown.
`recover` callbacks are ran if the record is recovered. Note that the
attribute is directly updated in the database, so no `save` or `update`
callbacks are ran. Also, any change made to the model is discarted as it is
reloaded.

@return bool
@throws BadMethodCallException
Recovers a deleted object by setting the DELETED_AT_ATTRIBUTE to null . If the object is not deleted no action is taken . If the object isn t recoverable however an exception is thrown . recover callbacks are ran if the record is recovered . Note that the attribute is directly updated in the database so no save or update callbacks are ran . Also any change made to the model is discarted as it is reloaded .