17 import(
'classes.publicationFormat.IdentificationCode');
24 parent::__construct();
33 function getById($identificationCodeId, $publicationId =
null){
34 $sqlParams = array((
int) $identificationCodeId);
36 $sqlParams[] = (int) $publicationId;
41 FROM identification_codes i
42 JOIN publication_formats pf ON (i.publication_format_id = pf.publication_format_id)
43 WHERE i.identification_code_id = ?
44 ' . ($publicationId?
' AND pf.publication_id = ?':
''),
49 if ($result->RecordCount() != 0) {
50 $returner = $this->
_fromRow($result->GetRowAssoc(
false));
63 'SELECT * FROM identification_codes WHERE publication_format_id = ?', (
int) $publicationFormatId);
84 $identificationCode->setId($row[
'identification_code_id']);
85 $identificationCode->setCode($row[
'code']);
86 $identificationCode->setValue($row[
'value']);
87 $identificationCode->setPublicationFormatId($row[
'publication_format_id']);
89 if ($callHooks)
HookRegistry::call(
'IdentificationCodeDAO::_fromRow', array(&$identificationCode, &$row));
91 return $identificationCode;
100 'INSERT INTO identification_codes
101 (publication_format_id, code, value)
105 (
int) $identificationCode->getPublicationFormatId(),
106 $identificationCode->getCode(),
107 $identificationCode->getValue()
112 return $identificationCode->getId();
121 'UPDATE identification_codes
122 SET code = ?, value = ?
123 WHERE identification_code_id = ?',
125 $identificationCode->getCode(),
126 $identificationCode->getValue(),
127 (
int) $identificationCode->getId()
137 return $this->
deleteById($identificationCode->getId());
146 'DELETE FROM identification_codes WHERE identification_code_id = ?', array((
int) $entryId)
155 return $this->
_getInsertId(
'identification_codes',
'identification_code_id');