* Db/Mapper.php: - Mapper inherits from AbstractModel for generic getters/setters, constructors must be `protected'
/trunk/Db/Mapper.php |
---|
1,6 → 1,5 |
<?php |
require_once __DIR__ . '/../AbstractModel.php'; |
require_once __DIR__ . '/Table.php'; |
/** |
8,7 → 7,7 |
* |
* @author Thomas Lahn |
*/ |
abstract class Mapper extends AbstractModel |
abstract class Mapper |
{ |
/** |
* Class name of the associated table model |
65,16 → 64,6 |
} |
/** |
* Returns the <code>Table</code> for this object. |
* |
* @return Table |
*/ |
public function getTable () |
{ |
return $this->getDbTable(); |
} |
/** |
* Sorts an array of objects by the property of the nested object. |
* To be used with the u*sort() functions. |
* |
/trunk/AbstractModel.php |
---|
28,7 → 28,7 |
* @param array $data Initialization data (optional) |
* @param array $mapping Mapping for initialization data (optional) |
*/ |
protected function __construct(array $data = null, array $mapping = null) |
public function __construct(array $data = null, array $mapping = null) |
{ |
if (!is_null($data)) |
{ |
154,8 → 154,6 |
* @param bool $exclusive = false |
* <p>If <code>true</code>, <em>only</em> the keys of $data that are present |
* in $mapping are mapped.</p> |
* @return AbstractModel |
* The modified object |
*/ |
public function map(array $data, array $mapping = null, $exclusive = false) |
{ |
183,7 → 181,5 |
} |
} |
} |
return $this; |
} |
} |