Reads the entity data.
@param DataContainer $data
@return $this
352976
public function readData(DataContainer $data)
    {
        $this->size = $data->getInteger('s', self::DEFAULT_SIZE);
        $this->renderedSize = $data->getInteger('r', self::DEFAULT_SIZE);
        $this->layers = array_map(function (DataContainer $data): Layer {
            return (new Layer())->readData($data);
        }, $data->getObjectArray('l'));
        return $this;
    }
516496
protected function checkData($data)
    {
        if (!$data instanceof $this->flexible_entity_class) {
            throw new ConverterException(
                sprintf(
                    "This converter only knows how to convert entities of type '%s' ('%s' given).",
                    $this->flexible_entity_class,
                    get_class($data)
                )
            );
        }

        return $this;
    }
854119
public function readData(DataContainer $data)
    {
        $this->type = $data->getString('t', '');
        $this->name = $data->getString('n', '');
        $this->labels->readData($data->getObject('l'));
        $this->descriptions->readData($data->getObject('d'));
        $this->providesRecipeLocalisation = $data->getInteger('r', 0) === 1;
        $this->providesMachineLocalisation = $data->getInteger('m', 0) === 1;
        $this->iconHash = $data->getString('i');
        $this->isNew = $data->getInteger('e', 1) === 1;
        return $this;
    }
1174384
public function setData($data)
    {
        if (!$data instanceof \SimpleXMLElement) {
            throw new \InvalidArgumentException(__METHOD__ . ' argument should be instance of ' . \SimpleXMLElement::class);
        }

        $this->data = $data;

        return $this;
    }
121489
public static function fromData(array $data)
    {
        $class = get_called_class();
        $isDynamic = is_a($class, DynamicEntity::class, true);

        /** @var static $entity */
        $entity = (new \ReflectionClass($class))->newInstanceWithoutConstructor();

        object_set_properties($entity, $data, $isDynamic);

        if (method_exists($entity, '__construct')) {
            $entity->__construct();
        }

        $entity->markNew(false);

        return $entity;
    }
11488
public function collect($data)
    {
        $this->_map = $this->objectToArray($data);
        $this->_baseContents = &$this->_map;

        return $this;
    }
415070
public function setData($data)
    {
        if (true === is_object($data)) {
            return $this->setDataObject($data);
        }

        $this->_picpath = null;
        $this->_isValid = null;
        $this->_domdocument = null;
        $this->_zones = null;

        $this->_data = $data;

        return $this;
    }
1273040
public function readData(DataContainer $data)
    {
        $this->type = $data->getString('t', '');
        $this->name = $data->getString('n', '');
        $this->amountMin = $data->getFloat('i', 1.);
        $this->amountMax = $data->getFloat('a', 1.);
        $this->probability = $data->getFloat('p', 1.);
        $this->order = $data->getInteger('o', 0);
        return $this;
    }
997692
public function bind($data)
    {
        foreach ($this->fields as $name => $field) {
            $value = FormHelper::getByPath($data, $name);

            if ($value !== null) {
                $field->setValue($value);
            }
        }

        return $this;
    }
635817
public function readData(DataContainer $data)
    {
        $this->name = $data->getString('n', '');
        $this->mode = $data->getString('m', '');
        $this->ingredients = array_map(function (DataContainer $data): Ingredient {
            return (new Ingredient())->readData($data);
        }, $data->getObjectArray('i'));
        $this->products = array_map(function (DataContainer $data): Product {
            return (new Product())->readData($data);
        }, $data->getObjectArray('p'));
        $this->craftingTime = $data->getFloat('c', 0.);
        $this->craftingCategory = $data->getString('a', '');
        $this->labels->readData($data->getObject('l'));
        $this->descriptions->readData($data->getObject('d'));
        $this->iconHash = $data->getString('h', '');
        return $this;
    }
1351084
public function setData($data)
    {
        if (!is_array($data)) {
            throw new \InvalidArgumentException(sprintf('Messages custom data must be array, "%s" given.', gettype($data)));
        }

        if (array_key_exists("aps", $data)) {
            unset($data["aps"]);
        }

        foreach ($data as $key => $value) {
            $this->addCustomData($key, $value);
        }

        return $this;
    }
623476
public function setRawData(array $data)
    {
        $this->data = $data + $this->data;

        if ($data) {
            $this->loaded = true;
            $this->setDataSource('*', 'db');
        }

        return $this;
    }
694610
public function setData($data) 
	{
		if(is_array($data)) {
			$this->data = $data;
		}
		
		$args = func_get_args();
		$this->data[$args[0]] = $args[1];
		
		return $this;
	}
444953
public function setData(&$data)
    {
        /**
         * @var Cell\Cell $cell
         */
        foreach ($this->cells as $cell) {
            $cell->setData($data);
        }
        return $this;
    }
1097548
protected function saveEntity($data)
    {
        if ($data instanceof AbstractData) {
            $data->setUpdatedAt(new \DateTime());
        }
        parent::saveEntity($data);
    }
1228204
protected static function exeRead(string $entity, $data = null)
    {
        if (!is_array($data) && !is_numeric($data))
            return null;

        if (is_array($data)) {
            $read = new TableCrud($entity);
            $read->loadArray($data);
            if ($read->exist())
                $data = (int)$read->getDados()['id'];

            if (empty($data) || !is_numeric($data))
                return null;
        }

        return self::readValues($entity, $data);
    }
1081710
public function setData($data)
    {
        if (!$data instanceof CollectorInterface) {
            $data = new Collector($data);
        }

        $this->data = $data;

        return $this;
    }