I have a function that takes a member of a particular class:
public function addPage(My_Page $page)
{
// ...
}
I\'d like to make another
if you use the class, you can do some thing like this:
interface addPageInterface
{
public function someThing();
}
class page implements addPageInterface
{
public function someThing()
{
//for example: create a page
}
}
class addPage
{
public function __construct(addPageInterface $page)
{
//do some thing...
return $page; //this will return just one page
}
}
class addPages
{
public function __construct(addPageInterface... $page)
{
//do some thing...
return $page; //this will return an array which contains of page
}
}