其中一个问题......我试着说清楚。
首先是错误:
at UnitOfWork ->computeAssociationChanges (array('fieldName' => 'currencyNumerator', 'joinColumns' => array(array('name' => 'currencyNumerator_id', 'referencedColumnName' => 'id')), 'cascade' => array(), 'inversedBy' => null, 'targetEntity' => 'NRtworks\BusinessDimensionBundle\Entity\Currency', 'fetch' => '2', 'type' => '2', 'mappedBy' => null, 'isOwningSide' => true, 'sourceEntity' => 'NRtworks\BusinessDimensionBundle\Entity\CurrencyValuation', 'isCascadeRemove' => false, 'isCascadePersist' => false, 'isCascadeRefresh' => false, 'isCascadeMerge' => false, 'isCascadeDetach' => false, 'sourceToTargetKeyColumns' => array('currencyNumerator_id' => 'id'), 'joinColumnFieldNames' => array('currencyNumerator_id' => 'currencyNumerator_id'), 'targetToSourceKeyColumns' => array('id' => 'currencyNumerator_id'), 'orphanRemoval' => false), '1')
in vendor/doctrine/orm/lib/Doctrine/ORM/UnitOfWork.php at line 687 +
当我试图保持对象currencyValuation时,会发生这种情况。
但是在我坚持它之前,这里是对象的打印:
object(stdClass)#531 (6) {
["__CLASS__"]=>
string(57) "NRtworks\BusinessDimensionBundle\Entity\CurrencyValuation"
["id"]=>
NULL
["value"]=>
string(1) "8"
["campaignAssigned"]=>
object(stdClass)#643 (12) {
["__CLASS__"]=>
string(48) "NRtworks\BusinessDimensionBundle\Entity\Campaign"
["__IS_PROXY__"]=>
bool(true)
["__PROXY_INITIALIZED__"]=>
bool(true)
["id"]=>
int(2)
["number"]=>
int(1)
["name"]=>
string(14) "ActualsJAN2015"
["status"]=>
string(11) "in progress"
["fiscalYear"]=>
int(2015)
["version"]=>
int(1)
["cycle"]=>
string(60) "Proxies\__CG__\NRtworks\BusinessDimensionBundle\Entity\Cycle"
["period"]=>
string(61) "Proxies\__CG__\NRtworks\BusinessDimensionBundle\Entity\Period"
["customer"]=>
string(58) "Proxies\__CG__\NRtworks\SubscriptionBundle\Entity\Customer"
}
["currencyNumerator"]=>
object(stdClass)#654 (5) {
["__CLASS__"]=>
string(48) "NRtworks\BusinessDimensionBundle\Entity\Currency"
["__IS_PROXY__"]=>
bool(true)
["__PROXY_INITIALIZED__"]=>
bool(true)
["id"]=>
int(2)
["name"]=>
string(3) "EUR"
}
["currencyDenominator"]=>
object(stdClass)#652 (3) {
["__CLASS__"]=>
string(48) "NRtworks\BusinessDimensionBundle\Entity\Currency"
["id"]=>
int(3)
["name"]=>
string(3) "CNY"
}
}
完成课程的一部分:
class CurrencyValuation implements JsonSerializable
{
/**
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
protected $id;
/**
* @ORM\Column(type="string", length=8)
*/
protected $value;
/**
* @ORM\ManyToOne(targetEntity="NRtworks\BusinessDimensionBundle\Entity\Campaign")
*/
protected $campaignAssigned;
/**
* @ORM\ManyToOne(targetEntity="NRtworks\BusinessDimensionBundle\Entity\Currency")
*/
protected $currencyNumerator;
/**
* @ORM\ManyToOne(targetEntity="NRtworks\BusinessDimensionBundle\Entity\Currency")
*/
protected $currencyDenominator;
}
正如你所看到的,我没有给它一个整数,只有它中的对象。我想知道是否可能是这些类是代理的事实。它可以 ?或者有什么我看不到的东西?