I have an abstract data mapper class:
<?php
abstract class ADataMapper
{
abstract public function addNew($dataObj);
abstract public function update($dataObj);
abstract public function find($primaryKey);
abstract public function delete($dataObj);
}
?>
In a sub-class of ADataMapper
, I need to find a row by a column that is not the primary key, specifically: 'filename'.
Would it be best to implement a method like findByFilename($filename)
or is there another, simpler alternative? I feel like I am just adding more complexity than necessary.