public function toResource(\Kontuak\Movement $movement) { $resource = new \AppBundle\Resources\Form\Resource\Movement(); $resource->amount = $movement->amount(); $resource->id = $movement->id()->toString(); $resource->concept = $movement->concept(); $resource->date = $movement->date()->format('Y-m-d'); return $resource; }
public static function fromMovement(\Kontuak\Movement $movement) { return new self($movement->id(), $movement->amount(), $movement->concept(), $movement->date(), $movement->created()); }