-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathAssets.php
More file actions
executable file
·88 lines (78 loc) · 2.35 KB
/
Assets.php
File metadata and controls
executable file
·88 lines (78 loc) · 2.35 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<?php
/**
* Assets refer to all the media files (images, videos, PDFs,
* audio files, and so on) uploaded in your Contentstack
* repository for future use.
*
* PHP version 5
*
* @category PHP
* @package Contentstack
* @author Uttam K Ukkoji <uttamukkoji@gmail.com>
* @author Rohit Mishra <rhtmishra4545@gmail.com>
* @copyright 2012-2021 Contentstack. All Rights Reserved
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
* @link https://pear.php.net/package/contentstack
* */
namespace Contentstack\Stack;
require_once __DIR__ . "/../Support/helper.php";
use Contentstack\Stack\ContentType\Query;
use Contentstack\Stack\BaseQuery;
use Contentstack\Support\Utility;
/**
* Assets refer to all the media files (images, videos, PDFs,
* audio files, and so on) uploaded in your Contentstack
* repository for future use.
*
* @category PHP
* @package Contentstack
* @author Uttam K Ukkoji <uttamukkoji@gmail.com>
* @author Rohit Mishra <rhtmishra4545@gmail.com>
* @copyright 2012-2021 Contentstack. All Rights Reserved
* @license https://github.com/contentstack/contentstack-php/blob/master/LICENSE.txt MIT Licence
* @link https://pear.php.net/package/contentstack
* */
#[\AllowDynamicProperties]
class Assets extends BaseQuery
{
var $operation;
var $assetUid = '';
var $stack = '';
var $type = '';
/**
* Assets constructor
*
* @param string $asset_uid - valid asset uid relevent to configured stack
* @param Stack $stack - valid stack configured details
* */
public function __construct($asset_uid = '', $stack = '')
{
if ($asset_uid == '') {
$this->stack = $stack;
$this->type = 'assets';
} else {
$stack->type = 'asset';
$this->assetUid = $asset_uid;
parent::__construct($stack, $this);
}
}
/**
* Query object to create the "Query" on the specified ContentType
*
* @return Query
* */
public function Query()
{
return new Query($this, $this->type);
}
/**
* Fetch the specified assets
*
* @return Request
* */
public function fetch()
{
$this->operation = __FUNCTION__;
return Utility::contentstackRequest($this->stack, $this, 'asset');
}
}