interface Query
{
/**
* @return string
*/
public function result();
}
class QueryInsert implements Query
{
public function result()
{
return 'QueryInsertString';
}
}
class QueryDelete implements Query
{
public function result()
{
return 'QueryDeleteString';
}
}
class QueryCollection
{
protected $queries = [];
/**
* @return void
*/
public function setQuery(Query $query)
{
$this->queries[] = $query;
}
/**
* @return string
*/
public function render()
{
$str = '';
foreach ($this->queries as $query) {
$str .= $query->result();
}
return $str;
}
}