Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class StepTable extends Table
* @var boolean
* @since 4.3.0
*/
// phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
protected $_supportNullValue = true;

/**
Expand Down
31 changes: 27 additions & 4 deletions administrator/components/com_guidedtours/src/Table/TourTable.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ class TourTable extends Table
* @var boolean
* @since 4.3.0
*/
// phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
protected $_supportNullValue = true;

/**
Expand All @@ -40,7 +39,6 @@ class TourTable extends Table
* @var array
* @since 4.3.0
*/
// phpcs:disable PSR2.Classes.PropertyDeclaration.Underscore
protected $_jsonEncode = ['extensions'];

/**
Expand Down Expand Up @@ -107,7 +105,6 @@ public function store($updateNulls = true)
*
* @since 4.3.0
*/
// phpcs:ignore
protected function _getAssetName(): string
{
$k = $this->_tbl_key;
Expand All @@ -122,9 +119,35 @@ protected function _getAssetName(): string
*
* @since 4.3.0
*/
// phpcs:ignore
protected function _getAssetTitle()
{
return $this->title;
}

/**
* Method to get the parent asset under which to register this one.
*
* By default, all assets are registered to the ROOT node with ID, which will default to 1 if none exists.
* The extended class can define a table and id to lookup. If the asset does not exist it will be created.
*
* @param Table $table A Table object for the asset parent.
* @param integer $id Id to look up
*
* @return integer
*
* @since 4.3.0
*/
protected function _getAssetParentId(Table $table = null, $id = null)
{
// We retrieve the parent asset from the Asset table
$assetParent = Table::getInstance('Asset');

$assetParent->loadByName('com_guidedtours');

if ($assetParent->id) {
return $assetParent->id;
}

return parent::_getAssetParentId($table, $id);
}
}
3 changes: 3 additions & 0 deletions ruleset.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
<exclude-pattern type="relative">administrator/components/com_fields/src/Table/GroupTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_finder/src/Table/FilterTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_finder/src/Table/LinkTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_guidedtours/src/Table/StepTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_guidedtours/src/Table/TourTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Model/DatabaseModel\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Model/InstallModel\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Table/UpdatesiteTable\.php</exclude-pattern>
Expand Down Expand Up @@ -156,6 +158,7 @@
<exclude-pattern type="relative">administrator/components/com_fields/src/Table/FieldTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_fields/src/Table/GroupTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_finder/src/Model/MapsModel\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_guidedtours/src/Table/TourTable\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Model/InstallerModel\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Model/InstallModel\.php</exclude-pattern>
<exclude-pattern type="relative">administrator/components/com_installer/src/Model/LanguagesModel\.php</exclude-pattern>
Expand Down