Skip to content

Instantly share code, notes, and snippets.

@makamo
Created April 13, 2015 20:13
Show Gist options
  • Save makamo/4befb91df2c1005eb753 to your computer and use it in GitHub Desktop.
Save makamo/4befb91df2c1005eb753 to your computer and use it in GitHub Desktop.
<?php
namespace App\Model\Entity;
use Cake\Database\Expression\QueryExpression;
use Cake\ORM\Entity;
use Cake\ORM\TableRegistry;
use Carbon\Carbon;
use Versadrill\Periode;
/**
* Paie Entity.
*/
class Paie extends Entity
{
public $periode_Fin;
public $periode_debut;
/**
* Fields that can be mass assigned using newEntity() or patchEntity().
*
* @var array
*/
protected $_accessible = [
'*' => true,
];
protected function _setDate(){
$date = $this->_setPeriode()["debut"];
return $date;
}
/**
* Déclare la date de debut et de fin d'une période
*/
protected function _setPeriode()
{
$p = Periode::getStartAndEndDate($this->week,$this->year);
$this->periode_debut =$p["debut"];
$this->periode_Fin = $p["fin"];
return $p;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment