Files
modelos/src/old/Venta/EstadoCierre.php

31 lines
693 B
PHP
Raw Normal View History

2019-12-23 18:01:23 -03:00
<?php
namespace Incoviba\old\Venta;
use Carbon\Carbon;
use Incoviba\Common\Alias\OldModel as Model;
/**
* @property int $id
* @property Cierre $cierre
* @property TipoEstadoCierre $tipo
* @property \DateTime $fecha
*/
class EstadoCierre extends Model
{
public function cierre()
{
return $this->belongsTo(Cierre::class, 'cierre')->findOne();
}
public function tipo()
{
return $this->belongsTo(TipoEstadoCierre::class, 'tipo')->findOne();
}
public function fecha(\DateTime $fecha = null)
{
if ($fecha == null) {
2020-01-07 12:25:52 -03:00
return Carbon::parse($this->fecha, $this->container->get('settings')->app->timezone);
2019-12-23 18:01:23 -03:00
}
$this->fecha = $fecha->format('Y-m-d');
}
}