{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"milestone":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/0f6dfdaeaa13420f2dd8301b0f2cbd38?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"0f6dfdaeaa13420f2dd8301b0f2cbd38","url":"https://api.github.com/users/joke2k","login":"joke2k","id":359076},"labels":[{"name":"Namespaces","color":"F010FA","url":"https://api.github.com/repos/propelorm/Propel/labels/Namespaces"}],"assignee":null,"updated_at":"2011-11-14T12:52:34Z","comments":2,"closed_at":null,"url":"https://api.github.com/repos/propelorm/Propel/issues/135","body":">Core\\Post\r\n>Core\\Author\r\n>Other\\AudioPost\r\n>Other\\VideoPost\r\n\r\n    <database namespace=\"Core\">\r\n    ...\r\n    <table name=\"post_item\" phpName=\"Post\"> \r\n      ...\r\n            <column name=\"class_key\" type=\"INTEGER\" inheritance=\"single\" >\r\n                <inheritance key=\"1\" class=\"Post\" />\r\n                <inheritance key=\"2\" class=\"AudioPost\" extends=\"Post\" package=\"other\" />\r\n                <inheritance key=\"3\" class=\"VideoPost\" extends=\"Post\" package=\"other\" />\r\n            </column>\r\n    </table>\r\n    <table name=\"post_author\" phpName=\"Author\"> ...</table>\r\n\r\ncalling :\r\n\r\n>foreach ( PostQuery::create()->find() as $post ) ...\r\n\r\nreturn :\r\n\r\n>Fatal error: Class 'Post' not found in ...**BasePostPeer.php**\r\n\r\n>PropelModelPager->getIterator( )\t..\\PropelModelPager.php:76\r\n>PropelModelPager->getResults( )\t..\\PropelModelPager.php:391\r\n>ModelCriteria->find( ??? )\t..\\PropelModelPager.php:101\r\n>PropelObjectFormatter->format( ??? )\t..\\ModelCriteria.php:1139\r\n>PropelObjectFormatter->getAllObjectsFromRow(  [...] )\t..\\PropelObjectFormatter.php:49\r\n>Core\\om\\BasePostPeer::populateObject( [...], 0,**FALSE** )\t..\\PropelObjectFormatter.php:87\r\n\r\npopulateObject call getOMClass with-out-Prefix that returns \"Post\" without a namespace.\r\n\r\n\r\nNeeds to improve a behaviour?","html_url":"https://github.com/propelorm/Propel/issues/135","title":"Single inheritance with different namespace classes","number":135,"id":1851019,"created_at":"2011-10-08T03:54:56Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/9adcfa21f7597a228dbfbb6d0ce5520e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"9adcfa21f7597a228dbfbb6d0ce5520e","url":"https://api.github.com/users/kstorch","login":"kstorch","id":1162374},"updated_at":"2011-11-14T12:52:34Z","url":"https://api.github.com/repos/propelorm/Propel/issues/comments/2729975","body":"I don't even have to define the package=\"other\" attribute. (Is this attribute documented anywhere?)\r\n\r\nFor those interested in a quick workaround: In my case it was enough to add the following function in my concrete Peer class. It has the behavior of the BasePeers with namespace, but without inheritance:\r\n* Return dot-Notation without Namespace if $withPrefix is true.\r\n* Return The full qualified class name if $withPrefix is false.\r\n\r\n```php\r\n\tpublic static function  getOMClass($row, $colnum, $withPrefix = true){\r\n\t\t$result = parent::getOMClass($row, $colnum, $withPrefix);\r\n\t\tif (!$withPrefix){\r\n\t\t\t$result =  __NAMESPACE__.'\\\\'.$result;\r\n\t\t}\t\t\r\n\t\treturn $result;\r\n\t}\r\n```\r\n\r\nPerhaps it's enough to add similar logic to the BasePeer, as I don't see a possibility to define inheriting classes in different namespaces via the inheritance-Tag. ","id":2729975,"created_at":"2011-11-14T12:52:34Z"}}