? GR0V Shell

GR0V shell

Linux www.koreapackagetour.com 2.6.32-042stab145.3 #1 SMP Thu Jun 11 14:05:04 MSK 2020 x86_64

Path : /home/admin/public_html/old/promice/Admin/src/QuPlupload/Entity/
File Upload :
Current File : /home/admin/public_html/old/promice/Admin/src/QuPlupload/Entity/PluploadHydrator.php

<?php
/**
 * @Author: Cel Ticó Petit
 * @Contact: cel@cenics.net
 * @Company: Cencis s.c.p.
 */

namespace QuPlupload\Entity;

use Zend\Stdlib\Hydrator\ClassMethods;

class PluploadHydrator extends ClassMethods
{

    /**
     * @param object $object
     * @return array
     * @throws Exception\InvalidArgumentException
     */
    public function extract($object)
    {
        if (!$object instanceof PluploadEntity) {
            throw new Exception\InvalidArgumentException('$object must be an instance of Plupload\Entity\PluploadEntity');
        }
        $data = parent::extract($object);
        $data = $this->mapField('id_plupload', 'id', $data);
        return $data;
    }

    /**
     * @param array $data
     * @param object $object
     * @return object
     * @throws Exception\InvalidArgumentException
     */
    public function hydrate(array $data, $object)
    {
        if (!$object instanceof PluploadEntity) {
            throw new Exception\InvalidArgumentException('$object must be an instance of Plupload\Entity\PluploadEntity');
        }
        $data = $this->mapField('id', 'id_plupload', $data);
        return parent::hydrate($data, $object);
    }

    protected function mapField($keyFrom, $keyTo, array $array)
    {
        $array[$keyTo] = $array[$keyFrom];
        unset($array[$keyFrom]);
        return $array;
    }
}

T1KUS90T
  root-grov@210.1.60.28:~$