- md5
- cb9ebe97b8b563f9b87ed34df1829982
- sha1
- 02fd1dfba0f61f58f501b754fae1681f2a63f293
- sha256
- 57547762ea13429db0c79400d93811246b100fe5ebc7e350b7d573fbc0946841
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113
<?php
/**
* @package Joomla.Administrator
* @subpackage com_workflow
*
* @copyright Copyright (C) 2005 - 2019 Open Source Matters, Inc. All rights reserved.
* @license GNU General Public License version 2 or later; see LICENSE.txt
*/
namespace Joomla\Component\Workflow\Administrator\Table;
defined('_JEXEC') or die;
use Joomla\CMS\Factory;
use Joomla\CMS\Table\Table;
use Joomla\Database\DatabaseDriver;
/**
* Transition table
*
* @since 4.0.0
*/
class TransitionTable extends Table
{
/**
* Indicates that columns fully support the NULL value in the database
*
* @var boolean
* @since 4.0.0
*/
protected $_supportNullValue = true;
/**
* Constructor
*
* @param \JDatabaseDriver $db Database connector object
*
* @since 4.0.0
*/
public function __construct(DatabaseDriver $db)
{
parent::__construct('#__workflow_transitions', 'id', $db);
$this->access = (int) Factory::getApplication()->get('access');
}
/**
* Overloaded store function
*
* @param boolean $updateNulls True to update fields even if they are null.
*
* @return mixed False on failure, positive integer on success.
*
* @see Table::store()
* @since 4.0.0
*/
public function store($updateNulls = true)
{
return parent::store($updateNulls);
}
/**
* Method to compute the default name of the asset.
* The default name is in the form table_name.id
* where id is the value of the primary key of the table.
*
* @return string
*
* @since 4.0.0
*/
protected function _getAssetName()
{
$k = $this->_tbl_key;
$workflow = new WorkflowTable($this->getDbo());
$workflow->load($this->workflow_id);
return $workflow->extension . '.transition.' . (int) $this->$k;
}
/**
* Method to return the title to use for the asset table.
*
* @return string
*
* @since 4.0.0
*/
protected function _getAssetTitle()
{
return $this->title;
}
/**
* Get the parent asset id for the record
*
* @param Table $table A JTable object for the asset parent.
* @param integer $id The id for the asset
*
* @return integer The id of the asset's parent
*
* @since 4.0.0
*/
protected function _getAssetParentId(Table $table = null, $id = null)
{
$asset = self::getInstance('Asset', 'JTable', array('dbo' => $this->getDbo()));
$workflow = new WorkflowTable($this->getDbo());
$workflow->load($this->workflow_id);
$name = $workflow->extension . '.workflow.' . (int) $workflow->id;
$asset->loadByName($name);
$assetId = $asset->id;
return !empty($assetId) ? $assetId : parent::_getAssetParentId($table, $id);
}
}
No other release has this exact content. See every version of this file.