Skip to content

Instantly share code, notes, and snippets.

@eminetto
Last active December 18, 2015 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eminetto/5709294 to your computer and use it in GitHub Desktop.
Save eminetto/5709294 to your computer and use it in GitHub Desktop.
<?php
namespace Application\Model;
class Item
{
public $id;
public $description;
public $done;
public function exchangeArray($data)
{
$this->id = (!empty($data['id'])) ? $data['id'] : null;
$this->description = (!empty($data['description'])) ? $data['description'] : null;
$this->done = (!empty($data['done'])) ? $data['done'] : null;
}
public function toArray()
{
$data = array(
'id' => $this->id,
'description' => $this->description,
'done' => $this->done
);
return $data;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment