You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To create a story, you can call the `create()` method provided by `StoryApi` and use the `StoryData` class. The `StoryData` class is specific for storing and handling story information. It also provides some nice methods for accessing some relevant Story fields.
322
+
To create a story, you can call the `create()` method provided by `StoryApi` and use the `Story` class. The `Story` class is specific for storing and handling story information. It also provides some nice methods for accessing some relevant Story fields.
323
+
And because a story stores also the content, you can use the StoryComponent class to handle the fields in the content.
328
324
329
325
```php
330
326
$content = new StoryComponent("article-page");
@@ -372,14 +368,25 @@ myslug-003;My Story 3 BULK;page
372
368
Next, you can implement a script to load and parse the CSV file. In this case, we use `SplFileObject` and then call the `createStories` method to process the data:
373
369
374
370
```php
371
+
372
+
use Storyblok\ManagementApi\Data\Story;
373
+
use Storyblok\ManagementApi\Data\StoryComponent;
374
+
use Storyblok\ManagementApi\Endpoints\StoryBulkApi;
375
+
use Storyblok\ManagementApi\ManagementApiClient;
376
+
377
+
$client = new ManagementApiClient($storyblokPersonalAccessToken);
375
378
$storyBulkApi = new StoryBulkApi($client, $spaceId);
0 commit comments