API Reference
Within your addons you will be able to access and manipulate content, data, and whatever else you can think of. In here, we explain all the classes you might care about and how to use them.
Generally speaking, you should use the classes in the Statamic\API
namespace as entry points to the API.
However, methods in those classes, as well as other areas may return classes outside of the Statamic\API
namespace. You will usually not need to create or instantiate these directly.
For example, want to create an entry? You will use Statamic\API\Entry::create()
, which returns an Statamic\Data\Entries\EntryFactory
, which will eventually return
a Statamic\Data\Entries\Entry
. You wouldn’t do new Entry
.
API Classes
- Statamic\API\Asset
- Statamic\API\AssetContainer
- Statamic\API\Collection
- Statamic\API\Content
- Statamic\API\Entry
- Statamic\API\File
- Statamic\API\Folder
- Statamic\API\GlobalSet
- Statamic\API\Page
- Statamic\API\PageFolder
- Statamic\API\Role
- Statamic\API\Taxonomy
- Statamic\API\Term
- Statamic\API\User
- Statamic\API\UserGroup
- Statamic\Assets\Asset
- Statamic\Data\Content\Content
- Statamic\Data\Content\ContentCollection
- Statamic\Data\Content\ContentFactory
- Statamic\Data\Data
- Statamic\Data\DataCollection
- Statamic\Data\Entries\AssetCollection
- Statamic\Data\Entries\Entry
- Statamic\Data\Entries\EntryCollection
- Statamic\Data\Entries\EntryFactory
- Statamic\Data\Globals\GlobalFactory
- Statamic\Data\Pages\Page
- Statamic\Data\Pages\PageFactory
- Statamic\Data\Pages\PagesCollection
- Statamic\Data\Taxonomies\Term
- Statamic\Data\Taxonomies\TermFactory
- Statamic\Data\Users\User
- Statamic\Data\Users\UserFactory