Skip to content

Commit 2199df3

Browse files
committed
refactor(model): Remove isGenerated method from PageAsset and update related documentation
Eliminate the isGenerated method from the PageAsset class and adjust README and example files accordingly to reflect this change.
1 parent 6ac7a07 commit 2199df3

4 files changed

Lines changed: 0 additions & 66 deletions

File tree

README.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,6 @@ Represents a complete page asset from dotCMS.
213213
- `template`: The Template object
214214
- `layout`: The Layout object
215215
- `containers`: Array of Container objects
216-
- `isGenerated()`: Check if the page is generated
217216

218217
## Error Handling
219218

examples/basic.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
echo "Page title: " . $page->page->title . "\n";
4141
echo "Page URL: " . $page->page->pageUrl . "\n";
4242
echo "Template name: " . $page->template->title . "\n";
43-
echo "Is generated page: " . ($page->isGenerated() ? 'Yes' : 'No') . "\n";
4443
echo "Number of containers: " . count($page->containers) . "\n\n";
4544

4645
// Example 2: Fetch a page asynchronously

src/Model/PageAsset.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,6 @@ public function __construct(
2929
) {
3030
}
3131

32-
/**
33-
* Check if this is a generated page (e.g., blog post, product page).
34-
*/
35-
public function isGenerated(): bool
36-
{
37-
return $this->urlContentMap !== null;
38-
}
39-
4032
/**
4133
* Specify data which should be serialized to JSON
4234
*

tests/Model/PageAssetTest.php

Lines changed: 0 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace Dotcms\PhpSdk\Tests\Model;
66

7-
use Dotcms\PhpSdk\Model\Contentlet;
87
use Dotcms\PhpSdk\Model\Layout\Layout;
98
use Dotcms\PhpSdk\Model\Page;
109
use Dotcms\PhpSdk\Model\PageAsset;
@@ -80,61 +79,6 @@ public function testConstructorAndBasicProperties(): void
8079
$this->assertEquals('/test-page', $pageAsset->page->pageUrl);
8180
}
8281

83-
public function testIsGenerated(): void
84-
{
85-
$pageAsset = $this->createPageAsset();
86-
$this->assertFalse($pageAsset->isGenerated());
87-
88-
// Create a visitor for the ViewAs
89-
$visitor = new Visitor(
90-
[], // tags
91-
'desktop', // device
92-
true, // isNew
93-
new UserAgent('Chrome', '120.0', 'Windows', false), // userAgent
94-
'https://example.com', // referer
95-
'test-dmid', // dmid
96-
new GeoLocation('Miami', 'United States', 'US', 25.7743, -80.1937, 'Florida'), // geo
97-
[] // personas
98-
);
99-
100-
// Create a basic language
101-
$language = [
102-
'id' => 1,
103-
'languageCode' => 'en',
104-
'countryCode' => 'US',
105-
'language' => 'English',
106-
'country' => 'United States',
107-
];
108-
109-
// Create a page asset with a urlContentMap
110-
$pageAssetWithContentMap = new PageAsset(
111-
new Layout(),
112-
new Template('template-id', 'Test Template', true), // drawed=true
113-
new Page(
114-
'page-id', // identifier
115-
'page-inode', // inode
116-
'Test Page', // title
117-
'content', // contentType
118-
'/test-page', // pageUrl
119-
true, // live
120-
true, // working
121-
'demo.dotcms.com', // hostName
122-
'site-id' // host
123-
),
124-
[], // containers
125-
new Site('site-id', 'demo.dotcms.com'),
126-
new Contentlet(
127-
'content-id', // identifier
128-
'content-inode', // inode
129-
'Test Content', // title
130-
'content' // contentType
131-
),
132-
new ViewAs($visitor, $language, 'PREVIEW')
133-
);
134-
135-
$this->assertTrue($pageAssetWithContentMap->isGenerated());
136-
}
137-
13882
public function testJsonSerialize(): void
13983
{
14084
$pageAsset = $this->createPageAsset();

0 commit comments

Comments
 (0)