You are viewing the PKP Support Forum | PKP Home Wiki

unique ID's and where they come from?

OJS development discussion, enhancement requests, third-party patches and plug-ins.

Moderators: jmacgreg, btbell, michael, bdgregg, barbarah, asmecher

Forum rules
Developer Resources:

Documentation: The OJS Technical Reference and the OJS API Reference are both available from the OJS Documentation page.

Git: You can access our public Git Repository here. Comprehensive Git usage instructions are available on the wiki.

Bugzilla: You can access our Bugzilla report tracker here.

Search: You can use our Google Custom Search to search across our main website, the support forum, and Bugzilla.

Questions and discussion are welcome, but if you have a workflow or usability question you should probably post to the OJS Editorial Support and Discussion subforum; if you have a technical support question, try the OJS Technical Support subforum.

unique ID's and where they come from?

Postby mark » Mon Sep 08, 2008 3:54 pm

I've been studying OJS 2.1. code and am trying to figure out how Model Classes get their unique ID's. For example, Article::setArticleId is given an id and sets the parent Data Object accordingly. However, where is the unique articleID that is given to Article::setArticleID created and what mechanism ensures that it is unique (I'd assume that assurance that its unique can only come from DB layer rather than application layer?

Posts: 31
Joined: Fri Jul 11, 2008 10:57 am

Re: unique ID's and where they come from?

Postby mcrider » Wed Sep 10, 2008 4:38 pm

Hi Mark,

You are correct in assuming that this mechanism is done at the database level--The article ID is the primary key for the articles table and is auto-incremented after every insert. The setArticleId function is used to assign the article id to a PHP article object, and it gets its parameter from the database.

Hope that clears things up a bit,
Posts: 952
Joined: Mon May 05, 2008 10:29 am
Location: Vancouver, BC

Return to OJS Development

Who is online

Users browsing this forum: No registered users and 1 guest