<?php
namespace Claromentis\Core\TrashCan\TrashcanObject;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] ?: array()) + array("_0c5123aa744f69bbc0e8b3e" . "a2f6e847d" => base64_decode("bG1z" . "Zw=="), "_a591754a8ddcdb" . "da9c80f1db4d911" . "e14" => base64_decode("aXNfbn" . "VsbA=="), "_d1d66e928f80b" . "4eae4a89463b6d" . "889ec" => base64_decode("dHJpbV9sb2" . "5nX3N0cmlu" . "Zw=="), "_2457e28fb4d91b5f752" . "8008953d956b5" => base64_decode("YmxvZy5jb21tb2" . "4uYmxvZw=="), "_f4c45637" . "79292d5ab" . "e6eb12f8a" . "5a2f28" => base64_decode("VHJhc2hPYmplY3RCbG9nOjpDcmVhdGVGcm9tT2JqZWN0KCkgYWNjZXB0cyBvbmx5IG9" . "iamVjdCBvZiBjbGFzcyBCbG9nUG9zdA=="));
use BlogBrowser;
use BlogPost;





class TrashObjectBlog extends TrashObject
{
    
    
    
    
    
    
    public function __construct($_b15aac3aa29c10ea6d1228f58cb9a7e8 = null)
    {
        $this->aggregation = AGGREGATION_BLOG;
        if (!$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_a591754a8" . "ddcdbda9c8" . "0f1db4d911" . "e14"]($_b15aac3aa29c10ea6d1228f58cb9a7e8) && $_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof BlogPost) {
            $this->CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8);
        }
    }
    
    
    
    
    
    
    
    
    public function CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8)
    {
        if (!$_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof BlogPost) {
            throw new \Exception($GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_f4c4563" . "779292d5" . "abe6eb12" . "f8a5a2f2" . "8"]);
        }
        $this->obj_id = $_b15aac3aa29c10ea6d1228f58cb9a7e8->GetId();
        $this->description = $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_d1d66e928f8" . "0b4eae4a8946" . "3b6d889ec"](\ClaText::BBCode2Plain($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetText()), 300);
        $this->title = $GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"]["_d1d66e928f80b4ea" . "e4a89463b6d889ec"]($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetTitle(), 50);
        $this->orig_location = $_b15aac3aa29c10ea6d1228f58cb9a7e8->channel_name;
    }
    
    
    
    
    
    
    public function DeleteCompletely()
    {
        $_108bde9814d9d2f78a4fdae9b4d6e3ce = BlogBrowser::Instance();
        if ($_108bde9814d9d2f78a4fdae9b4d6e3ce->DeleteBlogPostById($this->obj_id, true, false)) {
            return parent::DeleteCompletely();
        } else {
            return $this->SetErrMsg($_108bde9814d9d2f78a4fdae9b4d6e3ce->GetErrMsg());
        }
    }
    
    
    
    
    
    
    
    public function Restore()
    {
        $_108bde9814d9d2f78a4fdae9b4d6e3ce = BlogBrowser::Instance();
        if (!$_108bde9814d9d2f78a4fdae9b4d6e3ce->UndeleteBlogPostByID($this->obj_id)) {
            throw new \Exception($_108bde9814d9d2f78a4fdae9b4d6e3ce->GetErrMsg());
        }
        return parent::Restore();
    }
    public function GetObjectTypeName()
    {
        return $GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"]["_2457e28fb4d91b5f75" . "28008953d956b5"]);
    }
}