public function undelete()
    {
        static::checkReadOnly();

        $column = static::SOFT_DELETE;
        if ($column) {
            switch (static::SOFT_DELETE_MODE) {
                case 'deleted':
                    $value = 0;
                    break;

                case 'active':
                    $value = 1;
                    break;

                case 'stamp':
                    $value = null;
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s has invalid SOFT_DELETE_MODE mode: '%s'",
                        static::class,
                        static::SOFT_DELETE_MODE
                    ));
                    break;
            }
            $this->__set($column, $value);
            if ($this->isFresh()) {
                return true;
            }
            return $this->update($column);
        }

        $message = 'Model ' . static::class . ' is not soft-deletable';
        throw new \LogicException($message);
    }
public function undelete()
    {
        static::checkReadOnly();

        $column = static::SOFT_DELETE;
        if ($column) {
            switch (static::SOFT_DELETE_MODE) {
                case 'deleted':
                    $value = 0;
                    break;

                case 'active':
                    $value = 1;
                    break;

                case 'stamp':
                    $value = null;
                    break;

                default:
                    throw new \LogicException(sprintf(
                        "%s has invalid SOFT_DELETE_MODE mode: '%s'",
                        static::class,
                        static::SOFT_DELETE_MODE
                    ));
                    break;
            }
            $this->__set($column, $value);
            if ($this->isFresh()) {
                return true;
            }
            return $this->update($column);
        }

        $message = 'Model ' . static::class . ' is not soft-deletable';
        throw new \LogicException($message);
    }
public function undelete ( ) { static :: checkReadOnly ( ) ; $ column = static :: SOFT_DELETE ; if ( $ column ) { switch ( static :: SOFT_DELETE_MODE ) { case 'deleted' : $ value = 0 ; break ; case 'active' : $ value = 1 ; break ; case 'stamp' : $ value = null ; break ; default : throw new \ LogicException ( sprintf ( "%s has invalid SOFT_DELETE_MODE mode: '%s'" , static :: class , static :: SOFT_DELETE_MODE ) ) ; break ; } $ this -> __set ( $ column , $ value ) ; if ( $ this -> isFresh ( ) ) { return true ; } return $ this -> update ( $ column ) ; } $ message = 'Model ' . static :: class . ' is not soft-deletable' ; throw new \ LogicException ( $ message ) ; }
Sets the SOFT_DELETE column to a undeleted state

@return boolean For success or failure

@throws ReadOnlyModelException @see checkReadOnly()
@throws \LogicException        If the Model is not soft-deletable
@throws \LogicException        If SOFT_DELETE_MODE is unknown
Sets the SOFT_DELETE column to a undeleted state