0

我正在使用 API 平台框架创建 API REST。我有一个具有复合主键的实体。

在表上发送获取请求时出现此错误Umlfiles_Properties

实体 AppBundle\Entity\Umlfiles_Properties 中的复合主键上不允许使用单个 id

下面的代码是Umlfiles_Properties实体代码。

/**
* Umlfiles_Properties
*
* @ApiResource
* @ORM\Table(name="umlfiles_properties")
* @ORM\Entity(repositoryClass="AppBundle\Repository\Umlfiles_PropertiesRepository")
*/
class Umlfiles_Properties
{
/**
 * @var int
 *
 * @ORM\Column(name="umlfile_id", type="integer")
 * @ORM\Id
 * @ORM\ManyToOne(targetEntity="Umlfiles", inversedBy="id")
 */
private $umlfile_id;

/**
 * @var int
 *
 * @ORM\Column(name="property_id", type="integer")
 * @ORM\Id
 * @ORM\ManyToOne(targetEntity="Property", inversedBy="id")
 */
private $property_id;

/**
 * @var array
 *
 * @ORM\Column(name="value", type="array")
 */
private $value;



/**
 * Set umlfileId.
 *
 * @param int $umlfileId
 *
 * @return Umlfiles_Properties
 */
public function setUmlfileId($umlfileId)
{
    $this->umlfile_id = $umlfileId;

    return $this;
}

/**
 * Get umlfileId.
 *
 * @return int
 */
public function getUmlfileId()
{
    return $this->umlfile_id;
}

/**
 * Set propertyId.
 *
 * @param int $propertyId
 *
 * @return Umlfiles_Properties
 */
public function setPropertyId($propertyId)
{
    $this->property_id = $propertyId;

    return $this;
}

/**
 * Get propertyId.
 *
 * @return int
 */
public function getPropertyId()
{
    return $this->property_id;
}

/**
 * Set value.
 *
 * @param array $value
 *
 * @return Umlfiles_Properties
 */
public function setValue($value)
{
    $this->value = $value;

    return $this;
}

/**
 * Get value.
 *
 * @return array
 */
public function getValue()
{
    return $this->value;
}
}
4

0 回答 0