/**
* Creates an association for the workflow_associations table
*
* @param integer $pk ID of the item
* @param integer $state ID of state
*
* @return boolean
*
* @since 4.0.0
*/
public function createAssociation(int $pk, int $state) : bool
{
try {
$query = $this->db->getQuery(true);
$query->insert($this->db->quoteName('#__workflow_associations'))->columns([$this->db->quoteName('item_id'), $this->db->quoteName('stage_id'), $this->db->quoteName('extension')])->values(':pk, :state, :extension')->bind(':pk', $pk, ParameterType::INTEGER)->bind(':state', $state, ParameterType::INTEGER)->bind(':extension', $this->extension);
$this->db->setQuery($query)->execute();
} catch (\Exception $e) {
return false;
}
return true;
}