Project.php
1.41 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
<?php
namespace Nextend\SmartSlider3\PublicApi;
use Nextend\SmartSlider3\Application\ApplicationSmartSlider3;
use Nextend\SmartSlider3\Application\Model\ModelSliders;
use Nextend\SmartSlider3\BackupSlider\ImportSlider;
/**
* Class Project
*
* This class contains the publicly available static methods to interact with projects.
*
* @package Nextend\SmartSlider3
*/
class Project {
/**
* @param int $projectID
*
* @example \Nextend\SmartSlider3\PublicApi\Project::clearCache(6);
*
*/
public static function clearCache($projectID) {
$application = ApplicationSmartSlider3::getInstance();
$applicationType = $application->getApplicationTypeFrontend();
$sliderModal = new ModelSliders($applicationType);
$sliderModal->refreshCache($projectID);
}
/**
* @param string $pathToFile
*
* @return bool|int projectID on success. false on failure.
*
* @example \Nextend\SmartSlider3\PublicApi\Project::import('/path/to/project.ss3');
*/
public static function import($pathToFile) {
$application = ApplicationSmartSlider3::getInstance();
$applicationType = $application->getApplicationTypeAdmin();
$import = new ImportSlider($applicationType);
$projectID = $import->import($pathToFile);
if ($projectID !== false) {
return $projectID;
}
return false;
}
}