2016-03-26 22:08:01 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Patch testing component for the Joomla! CMS
|
|
|
|
*
|
2018-09-01 14:32:23 +00:00
|
|
|
* @copyright Copyright (C) 2011 - 2012 Ian MacLennan, Copyright (C) 2013 - 2018 Open Source Matters, Inc. All rights reserved.
|
2016-03-26 22:08:01 +00:00
|
|
|
* @license GNU General Public License version 2 or later
|
|
|
|
*/
|
|
|
|
|
|
|
|
namespace PatchTester\Model;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Methods supporting applied pull requests.
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2019-08-28 00:57:15 +00:00
|
|
|
class TestsModel extends AbstractModel
|
2016-03-26 22:08:01 +00:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Retrieves a list of applied patches
|
|
|
|
*
|
2020-03-31 18:19:05 +00:00
|
|
|
* @return array List of applied patches
|
2016-03-26 22:08:01 +00:00
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2020-03-31 18:19:05 +00:00
|
|
|
public function getAppliedPatches(): array
|
2016-03-26 22:08:01 +00:00
|
|
|
{
|
|
|
|
$db = $this->getDb();
|
|
|
|
|
|
|
|
$db->setQuery(
|
|
|
|
$db->getQuery(true)
|
|
|
|
->select('*')
|
|
|
|
->from($db->quoteName('#__patchtester_tests'))
|
|
|
|
->where($db->quoteName('applied') . ' = 1')
|
|
|
|
);
|
|
|
|
|
|
|
|
return $db->loadObjectList('pull_id');
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Truncates the tests table
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*
|
|
|
|
* @since 2.0
|
|
|
|
*/
|
2020-03-31 18:19:05 +00:00
|
|
|
public function truncateTable(): void
|
2016-03-26 22:08:01 +00:00
|
|
|
{
|
|
|
|
$this->getDb()->truncateTable('#__patchtester_tests');
|
|
|
|
}
|
|
|
|
}
|