src/articles/classes/Entity/Article.php
protected function setImage($value)
    {
        /** @var Articles $plugin */
        $plugin = $this->getTable()->getPlugin();
        if (null === $value && $this->imageUrl)
        {
            $root = Eresus_Kernel::app()->getLegacyKernel()->fdata;
            @unlink($root . $plugin->getName() . '/' . $this->id . '.jpg');
            @unlink($root . $plugin->getName() . '/' . $this->id . '-thmb.jpg');
        }
        elseif (is_uploaded_file($_FILES[$value]['tmp_name']))
        {
            $this->tmpFile = upload('image',
                tempnam(Eresus_Kernel::app()->getFsRoot() . 'var', $plugin->getName()));
        }
    }
protected function setImage($value)
    {
        /** @var Articles $plugin */
        $plugin = $this->getTable()->getPlugin();
        if (null === $value && $this->imageUrl)
        {
            $root = Eresus_Kernel::app()->getLegacyKernel()->fdata;
            @unlink($root . $plugin->getName() . '/' . $this->id . '.jpg');
            @unlink($root . $plugin->getName() . '/' . $this->id . '-thmb.jpg');
        }
        elseif (is_uploaded_file($_FILES[$value]['tmp_name']))
        {
            $this->tmpFile = upload('image',
                tempnam(Eresus_Kernel::app()->getFsRoot() . 'var', $plugin->getName()));
        }
    }
protected function setImage ( $ value ) { /** @var Articles $plugin */ $ plugin = $ this -> getTable ( ) -> getPlugin ( ) ; if ( null === $ value && $ this -> imageUrl ) { $ root = Eresus_Kernel :: app ( ) -> getLegacyKernel ( ) -> fdata ; @ unlink ( $ root . $ plugin -> getName ( ) . '/' . $ this -> id . '.jpg' ) ; @ unlink ( $ root . $ plugin -> getName ( ) . '/' . $ this -> id . '-thmb.jpg' ) ; } elseif ( is_uploaded_file ( $ _FILES [ $ value ] [ 'tmp_name' ] ) ) { $ this -> tmpFile = upload ( 'image' , tempnam ( Eresus_Kernel :: app ( ) -> getFsRoot ( ) . 'var' , $ plugin -> getName ( ) ) ) ; } }
Задаёт изображение

Если $value — null, изображение будет удалено

@param string|null $value

@since 3.01
Задаёт изображение