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

$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"] ?: array()) + array("_9b1c9897fe9407921b8d90" . "96cb566c04" => base64_decode("bmV3cy5hZG1pbi50cmF" . "zaC5uZXdzX2l0ZW0="), "_a591754" . "a8ddcdbd" . "a9c80f1d" . "b4d911e1" . "4" => base64_decode("aXNfbn" . "VsbA=="), "_dd0d63494d8d5afb29437ee411ac" . "34d0" => base64_decode("QW5ub3VuY2VtZW5" . "0"), "_d1d66e928f80b4eae4a8" . "9463b6d889ec" => base64_decode("dHJpbV9s" . "b25nX3N0" . "cmluZw=="), "_0c5123aa744" . "f69bbc0e8b3e" . "a2f6e847d" => base64_decode("bG1z" . "Zw=="), "_c73ac93b81fdf08d4c" . "425cd887c8ae49" => base64_decode("VHJhc2hPYmplY3ROZXdzOjpDcmVhdGVGcm9tT2JqZWN0KCkgYWNjZXB0cyBvbmx5IG9iamVjdCBvZiBjbGF" . "zcyBOZXdzSXRlbUJhc2U="));
use NewsBrowser;
use NewsItem;
use NewsItemBase;





class TrashObjectNews extends TrashObject
{
    
    
    
    
    
    
    public function __construct($_b15aac3aa29c10ea6d1228f58cb9a7e8 = null)
    {
        $this->aggregation = AGGREGATION_NEWS;
        if (!$GLOBALS["__65da1b1ec2d6653e8a0ab7848e53621" . "5"]["_a591754a8ddcdbda9c80f1db4d" . "911e14"]($_b15aac3aa29c10ea6d1228f58cb9a7e8) && $_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof NewsItemBase) {
            $this->CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8);
        }
    }
    
    
    
    
    
    
    
    
    public function CreateFromObject($_b15aac3aa29c10ea6d1228f58cb9a7e8)
    {
        if (!$_b15aac3aa29c10ea6d1228f58cb9a7e8 instanceof NewsItemBase) {
            throw new \Exception($GLOBALS["__65da1b1" . "ec2d6653e" . "8a0ab7848" . "e536215"]["_c73ac93b" . "81fdf08d4" . "c425cd887" . "c8ae49"]);
        }
        $this->obj_id = $_b15aac3aa29c10ea6d1228f58cb9a7e8->GetId();
        $this->description = $GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_d1d66e9" . "28f80b4e" . "ae4a8946" . "3b6d889e" . "c"](\ClaText::BBCode2Plain($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetText()), 300);
        $this->title = $GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_d1d66e928f80b4eae4a89463b6d" . "889ec"]($_b15aac3aa29c10ea6d1228f58cb9a7e8->GetTitle(), 50);
        $this->orig_location = $_b15aac3aa29c10ea6d1228f58cb9a7e8->is_headline ? $_b15aac3aa29c10ea6d1228f58cb9a7e8->channel_name : $GLOBALS["__65da1b1ec2d6653e8a0ab7848e53" . "6215"]["_dd0d63494d8d5afb29" . "437ee411ac34d0"];
    }
    
    
    
    
    
    
    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["__65da1b1ec2d6653e8" . "a0ab7848e536215"]["_0c5123aa744f" . "69bbc0e8b3ea2" . "f6e847d"]($GLOBALS["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_9b1c9897fe9407921b8d9096cb566c" . "04"]);
        
        
    }
}