Skip to content

Instantly share code, notes, and snippets.

@eminetto
Created Jun 8, 2014
Embed
What would you like to do?
<?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