Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Primary key #42

Closed
snezhkoigor opened this issue Nov 29, 2019 · 3 comments
Closed

Primary key #42

snezhkoigor opened this issue Nov 29, 2019 · 3 comments

Comments

@snezhkoigor
Copy link

if ($this->getPrimary($entity) === null) {

if in my table primary key === string not uuid?

now I try to do like this

/** @Cycle\Column(type = "primary", typecast = "string") */
    public $contract_number;

but get error

Cycle\ORM\Exception\ParserException: Unable to parse incoming row: Unable to typecast `contract_number`
@wolfy-j
Copy link
Contributor

wolfy-j commented Nov 29, 2019

Hi, typecast is a function to call, there is no such function "string". Try:

/** @cycle\Column(type = "string", primary=true) */

@wolfy-j
Copy link
Contributor

wolfy-j commented Nov 29, 2019

Check the column options available: https://cycle-orm.dev/docs/annotated-entity#columns

@snezhkoigor
Copy link
Author

thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants