cphalcon
cphalcon copied to clipboard
Refresh broken when using non-numeric ID
Calling refresh on a model that uses non-numeric IDs is broken and throws a PDO error (presumably because the ID is not quote-enclosed). EG:
class StringId extends \Phalcon\Mvc\Model {
/**
* @Primary
* @Identity
* @Column(type="string", nullable=false, length=10)
*/
public $id;
}
$stringId = new StringId();
$stringId->id = 'abcdefghij';
$stringId->create();
$stringId->refresh(); // <-- Fails with a PDO error
Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues