Skip to content

Instantly share code, notes, and snippets.

@Swader
Created September 13, 2012 14:50
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 Swader/3714792 to your computer and use it in GitHub Desktop.
Save Swader/3714792 to your computer and use it in GitHub Desktop.
User suggestion
<?php
/**
* Class User.php
*
* @category
* @package
* @license BSD License
* @version 0.01
* @since 2012-09-13
* @author Bruno Škvorc <bruno@skvorc.me>
*/
class User
{
protected $db;
// Properties i metode od usera
public function __construct() {
$this->db = new MysqlMapper();
}
}
interface UserMapper extends GeneralMapper {
function getContacts();
}
class MysqlMapper extends \INTECH\Api\Abstracts\Database implements UserMapper {
function getContacts() {
// Query
}
}
class PostgreMapper extends \INTECH\Api\Abstracts\Database implements UserMapper {
function getContacts() {
// Query
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment