Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created June 8, 2014 13:36
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/a38dc854af21e32447e4 to your computer and use it in GitHub Desktop.
Save eminetto/a38dc854af21e32447e4 to your computer and use it in GitHub Desktop.
<?php
namespace Application\Model;
class Post
{
public $id;
public $title;
public $description;
public $post_date;
//usado pelo TableGateway
public function exchangeArray($data)
{
$this->id = (!empty($data['id'])) ? $data['id'] : null;
$this->title = (!empty($data['title'])) ? $data['title'] : null;
$this->description = (!empty($data['description'])) ? $data['description'] : null;
$this->post_date = (!empty($data['post_date'])) ? $data['post_date'] : null;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment