Software Hosting and Development Services available at PKP Publishing Services
As the developers of Open Journal Systems, Open Conference Systems, Open Harvester Systems, and Open Monograph Press, the PKP team are experts in helping journal managers and conference organizers make the most of their online publishing projects. PKP Publishing Services offers support for:
As a customer of PKP Publishing Services, you will not only receive direct, personalized support from the PKP Development Team, but will be contributing to the ongoing development of the PKP applications. All funds raised by PKP Publishing Services go directly toward enhancing our free, open source software. For more information, please contact us.
OJS development discussion, enhancement requests, third-party patches and plug-ins.
Moderators: jmacgreg, michael, jheckman, barbarah, btbell, bdgregg, 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.
by Szdnez » Sat Jan 16, 2010 7:07 am
Hello,
is it possible to use method
getDataObjectSettings() more than 1 times for the same data object? For example
- Code: Select all
$this->getDataObjectSettings( 'issue_settings', 'issue_id', $row['issue_id'], $myData );
$this->getDataObjectSettings( 'article_settings', 'article_id', $row['article_id'], $myData );
The problem is, that both use
title in
setting_name -> second call of
getDataObjectSettings() overrides the data from the first call. Or must I do it by "hand"?
Thanks
-
Szdnez
-
- Posts: 17
- Joined: Tue Oct 20, 2009 12:48 pm
by Szdnez » Sat Jan 16, 2010 10:58 am
I wrote a method like this (nearly the same as original one, only one parameter more):
- Code: Select all
function getDataObjectSettings( $pTableName, $pIdFieldName, $pIdFieldValue, &$pDataObject, $pSuffixFieldName )
{
if ( $pIdFieldName !== null )
{
$sql = "SELECT * FROM $pTableName WHERE $pIdFieldName = ?";
$params = array( $pIdFieldValue );
}
else
{
$sql = "SELECT * FROM $pTableName";
$params = false;
}
$result =& $this->retrieve( $sql, $params );
$suffix = '';
if ( $pSuffixFieldName !== null )
{
$suffix = $pSuffixFieldName . '_';
}
while ( !$result->EOF )
{
$row = &$result->getRowAssoc( false );
$pDataObject->setData( $suffix . $row['setting_name'], $this->convertFromDB( $row['setting_value'], $row['setting_type'] ), $row['locale'] );
unset( $row );
$result->MoveNext();
}
$result->Close();
unset( $result );
}
-
Szdnez
-
- Posts: 17
- Joined: Tue Oct 20, 2009 12:48 pm
Return to OJS Development
Who is online
Users browsing this forum: No registered users and 1 guest