{"action":"opened","issue":{"number":1,"created_at":"2011-10-13T16:44:04Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"If there's a schema that has extended data in a different table that varies by a type ID, as in this example:\r\n\r\n\tgeneric\r\n\t-------\r\n\tgeneric_id PK AUTO_INCREMENT\r\n\tgeneric_type_id  (indicates which extended table to join to, e.g. extension1, extension2, etc.)\r\n\t[fields common amongst all extensions]\r\n\t\r\n\tgeneric_extension1\r\n\t------------------\r\n\tgeneric_id PK, not AUTO_INCREMENT\r\n\t[fields specific to the extension]\r\n\t\r\n\tgeneric_extension2\r\n\t------------------\r\n\tgeneric_id PK, not AUTO_INCREMENT\r\n\t[fields specific to the extension]\r\n\r\nThen one might except there to be `getGeneric_Object()` method on the `GenericExtension*` classes.  However, perhaps because this is the primary key, Cough does not look for these relationships.\r\n\r\nCurrent workaround is to provide the methods manually on an as-needed basis:\r\n\r\n\tpublic function loadGeneric_Object()\r\n\t{\r\n\t\t$this->setGeneric_Object(Generic::constructByKey($this->getKeyId()));\r\n\t}\r\n\t\r\n\tpublic function getGeneric_Object()\r\n\t{\r\n\t\tif (!isset($this->objects['Generic_Object']))\r\n\t\t{\r\n\t\t\t$this->loadGeneric_Object();\r\n\t\t}\r\n\t\treturn $this->objects['Generic_Object'];\r\n\t}\r\n\t\r\n\tpublic function setGeneric_Object($generic)\r\n\t{\r\n\t\t$this->objects['Generic_Object'] = $generic;\r\n\t}\r\n","comments":0,"title":"Generate (set|get|load|)_<entity>_Object() for PK","updated_at":"2011-10-13T16:44:04Z","url":"https://api.github.com/repos/awbush/coughphp/issues/1","id":1902185,"assignee":null,"milestone":null,"closed_at":null,"user":{"avatar_url":"https://secure.gravatar.com/avatar/5858b8906a653b749b0ddba17fc06853?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"5858b8906a653b749b0ddba17fc06853","url":"https://api.github.com/users/awbush","id":196966,"login":"awbush"},"html_url":"https://github.com/awbush/coughphp/issues/1","labels":[],"state":"open"},"legacy":{"number":1,"action":"opened","issue":1902185}}