bad code generation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
CoughPHP |
Fix Released
|
High
|
Anthony Bush |
Bug Description
hello, i have this (two) sql tables
CREATE TABLE `network` (
`id` int(11) NOT NULL auto_increment COMMENT 'PK',
`interfaceId` int(11) default NULL COMMENT 'FK_interface_id',
`ipAdresa` varchar(16) collate utf8_czech_ci NOT NULL COMMENT 'ip adresa site',
`maska` int(16) unsigned NOT NULL COMMENT 'maska site',
`ipRouter` varchar(16) collate utf8_czech_ci default NULL COMMENT 'ip adresa routeru',
`verejna` int(1) unsigned NOT NULL default '0' COMMENT 'boolean 1=je verejna / 0=neni verejna',
`isp` enum('sumnet'
PRIMARY KEY (`id`),
KEY `interfaceId` (`interfaceId`),
KEY `verejna` (`verejna`),
KEY `isp` (`isp`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=
CREATE TABLE `custPc` (
`id` int(11) NOT NULL auto_increment COMMENT 'PK',
`customerId` int(11) default NULL COMMENT 'FK customer id',
`popis` varchar(50) collate utf8_czech_ci NOT NULL COMMENT 'textovy popis pocitace',
`macAdresa` varchar(12) collate utf8_czech_ci default NULL COMMENT 'mac adresa stroje',
`networkId` int(11) default NULL COMMENT 'FK network id',
`ipAdresa` varchar(16) collate utf8_czech_ci default NULL COMMENT 'ip adresa stroje',
`networkIdVer
`ipAdresaVerejna` varchar(16) collate utf8_czech_ci default NULL COMMENT 'verejna ip adresa stroje',
`down` int(11) default NULL COMMENT 'rychlost downloadu',
`up` int(11) default NULL COMMENT 'rychlost uploadu',
PRIMARY KEY (`id`),
KEY `customerId` (`customerId`),
KEY `networkId` (`networkId`),
KEY `networkIdVerejna` (`networkIdVere
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=
ALTER TABLE `custPc`
ADD CONSTRAINT `custPc_ibfk_2` FOREIGN KEY (`customerId`) REFERENCES `customer` (`usr_id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `custPc_ibfk_3` FOREIGN KEY (`networkId`) REFERENCES `network` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
ADD CONSTRAINT `custPc_ibfk_4` FOREIGN KEY (`networkIdVere
so at brief, there are two relation between this two tables (networkId and networkIdVerejna(in eng.networkIdPu
<?php
/**
* This is the base class for CustPc.
*
* @see CustPc, CoughObject
**/
abstract class CustPc_Generated extends CoughObject {
...omited
public function loadNetwork_
$this-
}
public function getNetwork_Object() {
if (!isset(
$this-
}
return $this->
}
public function setNetwork_
$this-
}
public function loadNetwork_
$this-
}
public function getNetwork_Object() {
if (!isset(
$this-
}
return $this->
}
public function setNetwork_
$this-
}
// Generated one-to-many collection loaders, getters, setters, adders, and removers
...omited
so load/get/
Isn't it ?
i'm testing it on CoughPHP 1.3.2 (2008-09-22)
Adam Janosek
description: | updated |
Thank you for bug report, we will look into this soon.