cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

Refresh broken when using non-numeric ID

Open nsossonko opened this issue 11 years ago • 1 comments

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

nsossonko avatar Oct 20 '15 13:10 nsossonko

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

stale[bot] avatar Apr 17 '18 03:04 stale[bot]