PHP Class SubmissionDAO, pkp-lib

Inheritance: extends DAO
Mostrar archivo Open project: pkp/pkp-lib Class Usage Examples

Public Properties

Property Type Description
$authorDao
$cache

Public Methods

Method Description
__construct ( ) Constructor.
_cacheMiss ( $cache, $id ) : Monograph Callback for a cache miss.
_fromRow ( $row ) : Submission Internal function to return a Submission object from a row.
_getCache ( ) : Cache Get the submission cache.
changePubId ( $submissionId, $pubIdType, $pubId )
deleteAllPubIds ( $contextId, $pubIdType )
deleteByContextId ( $contextId ) Delete all submissions by context ID.
deleteById ( $submissionId ) Delete a submission by ID.
deleteObject ( $submission ) Delete a submission.
deletePermissions ( $contextId ) Delete the attached licenses of all submissions in a context.
deletePubId ( $submissionId, $pubIdType )
flushCache ( ) Flush the submission cache.
getActiveSubmissions ( $contextId = null, $title = null, $author = null, $editor = null, $stageId = null, $rangeInfo = null, $orphaned = false ) : DAOResultFactory Get all active submissions for a context.
getAdditionalFieldNames ( ) : array Get a list of additional fields that do not have dedicated accessors.
getAssignedById ( integer $submissionId, integer $userId, integer $contextId = null, boolean $useCache = false ) : Submission Retrieve a submission by ID only if the submission is not published, has been submitted, and does not belong to the user in question and is not STATUS_DECLINED.
getAssignedToOthers ( $userId, $contextId = null, $title = null, $author = null, $editor = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory Get all submissions that are assigned to users other than the passed one.
getAssignedToUser ( $userId, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory Get all submissions that are considered assigned to the passed user, excluding author participation.
getByContextId ( $contextId ) : DAOResultFactory Get all submissions for a context.
getById ( $submissionId, $contextId = null, $useCache = false ) : Submission Retrieve a submission by ID.
getByStatus ( $status, $userId = null, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory Get all submissions for a status.
getBySubEditorId ( $contextId, $subEditorId = null, $includeDeclined = true, $includePublished = true, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory Get all unassigned submissions for a context or all contexts
getByUserId ( $userId, $contextId = null ) : array Get all submissions for a user.
getInsertId ( ) : integer Get the ID of the last inserted submission.
getLocaleFieldNames ( ) : array Get a list of fields for which localized data is supported
getReviewerArchived ( $reviewerId, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory Get all submissions that a reviewer denied a review request.
getUnpublishedByUserId ( $userId, $contextId = null, $title = null, $stageId = null, $rangeInfo = null ) : array Get all unpublished submissions for a user.
newDataObject ( ) : Submission Instantiate a new data object.
pubIdExists ( $pubIdType, $pubId, $submissionId, $contextId )
updateLocaleFields ( $submission ) Update the settings for this object

Protected Methods

Method Description
_arrayWalkIntCast ( string $value ) : integer Sanity test to cast values to int for database queries.
getCompletionConditions ( $completed ) : string Get conditions required to establish whether the submission is "completed".
getCompletionJoins ( ) : string Get additional joins required to establish whether the submission is "completed".
getFetchColumns ( ) : string Return a SQL snippet of extra columns to fetch during submission fetch queries.
getFetchJoins ( ) : string Return a SQL snippet of extra joins to include during fetch queries.
getFetchParameters ( ) : array Return a list of extra parameters to bind to the submission fetch queries.
getGroupByColumns ( ) : string Return a SQL snippet of columns to group by the submission fetch queries.
getSubEditorJoin ( ) : string Return a SQL snippet of extra sub editor related join to include during fetch queries.

Private Methods

Method Description
_getEditorSearchQuery ( ) : string Get the editor search query for submissions.

Method Details

__construct() public method

Constructor.
public __construct ( )

_arrayWalkIntCast() protected method

Sanity test to cast values to int for database queries.
protected _arrayWalkIntCast ( string $value ) : integer
$value string
return integer

_cacheMiss() public method

Callback for a cache miss.
public _cacheMiss ( $cache, $id ) : Monograph
$cache Cache
$id string
return Monograph

_fromRow() public method

Internal function to return a Submission object from a row.
public _fromRow ( $row ) : Submission
$row array
return Submission

_getCache() public method

Get the submission cache.
public _getCache ( ) : Cache
return Cache

changePubId() public method

public changePubId ( $submissionId, $pubIdType, $pubId )

deleteAllPubIds() public method

public deleteAllPubIds ( $contextId, $pubIdType )

deleteByContextId() public method

Delete all submissions by context ID.
public deleteByContextId ( $contextId )
$contextId int

deleteById() public method

Delete a submission by ID.
public deleteById ( $submissionId )
$submissionId int

deleteObject() public method

Delete a submission.
public deleteObject ( $submission )
$submission Submission

deletePermissions() public method

Delete the attached licenses of all submissions in a context.
public deletePermissions ( $contextId )

deletePubId() public method

public deletePubId ( $submissionId, $pubIdType )

flushCache() public method

Flush the submission cache.
public flushCache ( )

getActiveSubmissions() public method

Get all active submissions for a context.
public getActiveSubmissions ( $contextId = null, $title = null, $author = null, $editor = null, $stageId = null, $rangeInfo = null, $orphaned = false ) : DAOResultFactory
$contextId int optional
$title string|null optional Filter by title.
$author string|null optional Filter by author.
$editor int|null optional Filter by editor name.
$stageId int|null optional Filter by stage id.
$rangeInfo DBResultRange optional
$orphaned boolean Whether the incomplete submissions that have no author assigned should be considered too
return DAOResultFactory

getAdditionalFieldNames() public method

Get a list of additional fields that do not have dedicated accessors.
public getAdditionalFieldNames ( ) : array
return array

getAssignedById() public method

Retrieve a submission by ID only if the submission is not published, has been submitted, and does not belong to the user in question and is not STATUS_DECLINED.
public getAssignedById ( integer $submissionId, integer $userId, integer $contextId = null, boolean $useCache = false ) : Submission
$submissionId integer
$userId integer
$contextId integer
$useCache boolean
return Submission

getAssignedToOthers() public method

Get all submissions that are assigned to users other than the passed one.
public getAssignedToOthers ( $userId, $contextId = null, $title = null, $author = null, $editor = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory
$userId int
$contextId int optional
$title string|null optional Filter by title.
$author string|null optional Filter by author.
$editor int|null optional Filter by editor name.
$stageId int|null optional Filter by stage id.
$rangeInfo DBResultRange optional
return DAOResultFactory

getAssignedToUser() public method

Get all submissions that are considered assigned to the passed user, excluding author participation.
public getAssignedToUser ( $userId, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory
$userId int
$contextId int optional
$title string|null optional Filter by title.
$author string|null optional Filter by author.
$stageId int|null optional Filter by stage id.
$rangeInfo DBResultRange optional
return DAOResultFactory

getByContextId() public method

Get all submissions for a context.
public getByContextId ( $contextId ) : DAOResultFactory
$contextId int
return DAOResultFactory containing matching Submissions

getById() public method

Retrieve a submission by ID.
public getById ( $submissionId, $contextId = null, $useCache = false ) : Submission
$submissionId int
$contextId int optional
$useCache boolean optional
return Submission

getByStatus() public method

Get all submissions for a status.
public getByStatus ( $status, $userId = null, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory
$status int Status to get submissions for
$userId int optional User to require an assignment for
$contextId mixed optional Context(s) to fetch submissions for
$title string optional
$author string optional
$stageId int optional
$rangeInfo DBResultRange optional
return DAOResultFactory

getBySubEditorId() public method

Get all unassigned submissions for a context or all contexts
public getBySubEditorId ( $contextId, $subEditorId = null, $includeDeclined = true, $includePublished = true, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory
$contextId int optional the ID of the context to query.
$subEditorId int optional the ID of the sub editor whose section will be included in the results (excluding others).
$includeDeclined boolean optional include submissions which have STATUS_DECLINED
$includePublished boolean optional include submissions which are published
$title string|null optional Filter by title.
$author string|null optional Filter by author.
$stageId int|null optional Filter by stage id.
$rangeInfo DBRangeInfo
return DAOResultFactory containing matching Submissions

getByUserId() public method

Get all submissions for a user.
public getByUserId ( $userId, $contextId = null ) : array
$userId int
$contextId int optional
return array Submissions

getCompletionConditions() abstract protected method

Get conditions required to establish whether the submission is "completed".
abstract protected getCompletionConditions ( $completed ) : string
$completed boolean True for completed submissions; false for incomplete
return string

getCompletionJoins() protected method

Get additional joins required to establish whether the submission is "completed".
protected getCompletionJoins ( ) : string
return string

getFetchColumns() abstract protected method

Return a SQL snippet of extra columns to fetch during submission fetch queries.
abstract protected getFetchColumns ( ) : string
return string

getFetchJoins() abstract protected method

Return a SQL snippet of extra joins to include during fetch queries.
abstract protected getFetchJoins ( ) : string
return string

getFetchParameters() abstract protected method

Return a list of extra parameters to bind to the submission fetch queries.
abstract protected getFetchParameters ( ) : array
return array

getGroupByColumns() abstract protected method

See bug #8557, all tables that have columns selected must have one column listed here to keep PostgreSQL happy.
abstract protected getGroupByColumns ( ) : string
return string

getInsertId() public method

Get the ID of the last inserted submission.
public getInsertId ( ) : integer
return integer

getLocaleFieldNames() public method

Get a list of fields for which localized data is supported
public getLocaleFieldNames ( ) : array
return array

getReviewerArchived() public method

It will list only the submissions that a review has denied ALL review assignments.
public getReviewerArchived ( $reviewerId, $contextId = null, $title = null, $author = null, $stageId = null, $rangeInfo = null ) : DAOResultFactory
$reviewerId int
$contextId int optional
$title string optional
$author string optional
$stageId int optional
$rangeInfo DBResultRange optional
return DAOResultFactory

getSubEditorJoin() abstract protected method

Return a SQL snippet of extra sub editor related join to include during fetch queries.
abstract protected getSubEditorJoin ( ) : string
return string

getUnpublishedByUserId() public method

Get all unpublished submissions for a user.
public getUnpublishedByUserId ( $userId, $contextId = null, $title = null, $stageId = null, $rangeInfo = null ) : array
$userId int
$contextId int optional
$rangeInfo DBResultRange optional
return array Submissions

newDataObject() public method

Instantiate a new data object.
public newDataObject ( ) : Submission
return Submission

pubIdExists() public method

public pubIdExists ( $pubIdType, $pubId, $submissionId, $contextId )

updateLocaleFields() public method

Update the settings for this object
public updateLocaleFields ( $submission )
$submission object

Property Details

$authorDao public_oe property

public $authorDao

$cache public_oe property

public $cache