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

$GLOBALS["__65da1b1ec2d" . "6653e8a0ab784" . "8e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5" . "36215"] ?: array()) + array("_dd0d63494d8d" . "5afb29437ee41" . "1ac34d0" => base64_decode("QW5ub3VuY2VtZ" . "W50"), "_d1d66e928" . "f80b4eae4a" . "89463b6d88" . "9ec" => base64_decode("dHJpbV9sb25nX" . "3N0cmluZw=="), "_0c5123aa744f69bbc0e8b" . "3ea2f6e847d" => base64_decode("bG1z" . "Zw=="), "_c73ac93b81fd" . "f08d4c425cd88" . "7c8ae49" => base64_decode("VHJhc2hPYmplY3ROZXdzOjpDcmVhdGVG" . "cm9tT2JqZWN0KCkgYWNjZXB0cyBvbmx5" . "IG9iamVjdCBvZiBjbGFzcyBOZXdzSXRl" . "bUJhc2U="), "_9b1c9897f" . "e9407921b8" . "d9096cb566" . "c04" => base64_decode("bmV3cy5hZG1" . "pbi50cmFzaC" . "5uZXdzX2l0Z" . "W0="), "_a591754a8ddcdbda9c80" . "f1db4d911e14" => base64_decode("aXN" . "fbn" . "Vsb" . "A=="));
use NewsBrowser;
use NewsItem;
use NewsItemBase;





class TrashObjectNews extends TrashObject
{
    
    
    
    
    
    
    public function __construct($_b15aac3aa29c10ea6d1228f58cb9a7e8 = null)
    {
        $this->aggregation = AGGREGATION_NEWS;
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_a591754a8" . "ddcdbda9c8" . "0f1db4d911" . "e14"]($_b15aac3aa29c10ea6d1228f58cb9a7e8) && $_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof NewsItemBase) {
            $this->CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8);
        }
    }
    
    
    
    
    
    
    
    
    public function CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8)
    {
        if (!$_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof NewsItemBase) {
            throw new \Exception($GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_c73ac93b" . "81fdf08d4" . "c425cd887" . "c8ae49"]);
        }
        $this->obj_id = $_b15aac3aa29c10ea6d1228f58cb9a7e8->GetId();
        $this->description = $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_d1d66e928f80b4eae4a89463b6" . "d889ec"](\ClaText::BBCode2Plain($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetText()), 300);
        $this->title = $GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"]["_d1d66e9" . "28f80b4e" . "ae4a8946" . "3b6d889e" . "c"]($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetTitle(), 50);
        $this->orig_location = $_b15aac3aa29c10ea6d1228f58cb9a7e8->is_headline ? $_b15aac3aa29c10ea6d1228f58cb9a7e8->channel_name : $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_dd0d63494d8d5a" . "fb29437ee411ac3" . "4d0"];
    }
    
    
    
    
    
    
    public function DeleteCompletely()
    {
        $_108bde9814d9d2f78a4fdae9b4d6e3ce = NewsBrowser::Instance();
        if ($_108bde9814d9d2f78a4fdae9b4d6e3ce->DeleteNewsById($this->obj_id, true, false)) {
            return parent::DeleteCompletely();
        } else {
            return $this->SetErrMsg($_108bde9814d9d2f78a4fdae9b4d6e3ce->GetErrMsg());
        }
    }
    
    
    
    
    
    
    
    public function Restore()
    {
        $_108bde9814d9d2f78a4fdae9b4d6e3ce = NewsBrowser::Instance();
        if (!$_108bde9814d9d2f78a4fdae9b4d6e3ce->UndeleteNewsById($this->obj_id)) {
            throw new \Exception($_108bde9814d9d2f78a4fdae9b4d6e3ce->GetErrMsg());
        }
        return parent::Restore();
    }
    public function GetObjectTypeName()
    {
        return $GLOBALS["__65da1b1ec2d6653e8a0ab7848" . "e536215"]["_0c5123aa744f69bbc0e8b3ea2f6e8" . "47d"]($GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"]["_9b1c9897fe9407921b" . "8d9096cb566c04"]);
        
        
    }
}