Created
October 13, 2011 22:25
-
-
Save hhamon/1285726 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
------ Symfony2 API --------------- | |
interface UserInterface | |
{ | |
// ... | |
public function equals(UserInterface $user); | |
} | |
------ Propel API --------------- | |
abstract class BaseObject | |
{ | |
public function equals($obj) | |
{ | |
// ... | |
} | |
} | |
------ My Propel Model Classes in My Symfony2 Bundle --------------- | |
class MyPropelUser extends BaseMyPropelUser implements UserInterface | |
{ | |
// Conflict because BaseObject::equals() and UserInterface::equals() methods | |
// don't have the same signature. | |
} |
No it does not work... You must respect the BaseObject::equals() method... That's why I want method overloading in PHP.
I encountered the same problem a few months ago, http://groups.google.com/group/symfony-users/browse_thread/thread/2eac5aeb5fcc5131?hl=en. For now i just create 'Proxy class' as suggested by willdurand.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
So I'm a bit fucked up now ^^