/** * Carga valores de un descuento de una empresa * @param $id_descuento * @return array|null|\yii\db\ActiveRecord */ public function cargarDescuento() { if ($this->descuento === null) { $this->descuento = Descuentos::findOne($this->iddescuento); $this->nombre = $this->descuento->nombre; $this->descripcion = $this->descuento->descripcion; $this->estado = $this->descuento->estado; $this->categoria = $this->descuento->categoria; $this->precio = $this->descuento->precio; $this->descuento->transacciones = $this->descuento->transacciones != descuentos::NO_ESPECIFICADO ? explode(',', $this->descuento->transacciones) : descuentos::NO_ESPECIFICADO; } return $this->descuento; }