-
Docs
Backend
-
Behaviors
-
Classes
-
Controllers
-
Database
-
Seeds
-
-
Facades
-
FormWidgets
-
Helpers
-
Exception
- Backend
-
-
Models
-
ReportWidgets
-
Skins
-
Traits
-
Widgets
- ServiceProvider
-
-
Cms
-
Classes
- Asset
- AutoDatasource
- CmsCompoundObject
- CmsController
- CmsException
- CmsObject
- CmsObjectCollection
- CodeBase
- CodeParser
- ComponentBase
- ComponentHelpers
- ComponentManager
- ComponentPartial
- Content
- Controller
- Layout
- LayoutCode
- MediaLibrary
- MediaLibraryItem
- MediaViewHelper
- Meta
- ObjectMemoryCache
- Page
- PageCode
- Partial
- PartialCode
- PartialStack
- Router
- Theme
- ThemeManager
-
Components
-
Contracts
-
Controllers
-
Facades
-
FormWidgets
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ComponentNode
- ComponentTokenParser
- ContentNode
- ContentTokenParser
- DebugExtension
- DefaultNode
- DefaultTokenParser
- Extension
- FlashNode
- FlashTokenParser
- FrameworkNode
- FrameworkTokenParser
- Loader
- PageNode
- PageTokenParser
- PartialNode
- PartialTokenParser
- PlaceholderNode
- PlaceholderTokenParser
- PutNode
- PutTokenParser
- ScriptsNode
- ScriptsTokenParser
- StylesNode
- StylesTokenParser
-
Widgets
- ServiceProvider
-
-
System
-
Behaviors
-
Classes
-
Console
-
Controllers
-
Database
-
Helpers
-
Models
-
ReportWidgets
-
Traits
-
Twig
- ServiceProvider
-
-
Events
-
backend
-
ajax
-
filter
-
form
-
list
-
menu
-
page
-
user
-
-
cms
-
ajax
-
block
-
combiner
-
component
-
object
-
page
-
router
-
template
-
theme
-
-
halcyon
-
datasource
-
-
mailer
-
media
-
model
-
system
-
assets
-
console
-
mirror
-
theme
-
-
reportwidgets
-
settings
- extendConfigFile
-
-
translator
-
-
Library
-
Argon
-
Auth
-
Models
- AuthException
- Manager
-
-
Config
-
Cookie
-
Middleware
-
-
Database
-
Attach
-
Behaviors
-
Concerns
-
Connections
-
Connectors
-
Models
-
Relations
-
Schema
-
Traits
-
Updates
- README
- Builder
- Collection
- DatabaseServiceProvider
- DataFeed
- Dongle
- MemoryCache
- Model
- ModelBehavior
- ModelException
- NestedTreeScope
- Pivot
- QueryBuilder
- SortableScope
- TreeCollection
- Updater
-
-
Events
-
Exception
-
Extension
-
Filesystem
-
Flash
-
Foundation
-
Bootstrap
-
Console
-
Exception
-
Http
-
Middleware
- Kernel
-
-
Providers
- Application
- Maker
-
-
Halcyon
-
Datasource
-
Exception
-
Processors
-
Traits
- README
- Builder
- Collection
- HalcyonServiceProvider
- MemoryCacheManager
- MemoryRepository
- Model
-
-
Html
-
Mail
-
Network
-
Parse
-
Router
-
Scaffold
-
Support
-
Translation
-
- Documentation
- API
- Library
- Halcyon
- Datasource
- DbDatasource
October\Rain\Halcyon\Datasource\DbDatasource
Source: ~/vendor/october/rain/src/Halcyon/Datasource/DbDatasource.php
Extends:
Implements:
Database based data source
Table Structure:
- id, unsigned integer
- source, varchar
- path, varchar
- content, longText
- file_size, unsigned integer // In bytes - NOTE: max file size of 4.29 GB represented with unsigned int in MySQL
- updated_at, datetime
- deleted_at, datetime, nullable
Protected properties
protected string $source
The identifier for this datasource instance
protected string $table
The table name of the datasource
Show inherited protected properties
Inherited protected properties
- protected bool $forceDeleting - defined in October\Rain\Halcyon\Datasource\Datasource. Indicates if the record is currently being force deleted.
- protected October\Rain\Halcyon\Processors\Processor $postProcessor - defined in October\Rain\Halcyon\Datasource\Datasource. The query post processor implementation.
- protected array $emitterSingleEventCollection - defined in October\Rain\Halcyon\Datasource\Datasource. Collection of registered events to be fired once only.
- protected array $emitterEventCollection - defined in October\Rain\Halcyon\Datasource\Datasource. Collection of registered events.
- protected array $emitterEventSorted - defined in October\Rain\Halcyon\Datasource\Datasource. Sorted collection of events.
Public methods
public void __construct(string $source, string $table)
Create a new datasource instance.
Parameters
- string $source - The source identifier for this datasource instance
- string $table - The table for this database datasource
public bool delete(string $dirName, string $fileName, string $extension)
Run a delete statement against the datasource.
Parameters
- string $dirName
- string $fileName
- string $extension
public array getAvailablePaths()
Get all available paths within this datastore
public void getBaseQuery()
Get the base QueryBuilder object
public string getPathsCacheKey()
Generate a paths cache key unique to this datasource
public QueryBuilder getQuery(bool $ignoreDeleted=true)
Get the QueryBuilder object
Parameters
- bool $ignoreDeleted - Flag to ignore deleted records, defaults to true
public bool insert(string $dirName, string $fileName, string $extension, string $content)
Creates a new template.
Parameters
- string $dirName
- string $fileName
- string $extension
- string $content
public int lastModified(string $dirName, string $fileName, string $extension)
Return the last modified date of an object
Parameters
- string $dirName
- string $fileName
- string $extension
public string makeCacheKey(string $name='')
Generate a cache key unique to this datasource.
Parameters
- string $name
public array select(string $dirName, array $options=array())
Returns all templates.
Parameters
- string $dirName
- array $options - Array of options, [ 'columns' => ['fileName', 'mtime', 'content'], // Only return specific columns 'extensions' => ['htm', 'md', 'twig'], // Extensions to search for 'fileMatch' => '*gr[ae]y', // Shell matching pattern to match the filename against using the fnmatch function 'orders' => false // Not implemented 'limit' => false // Not implemented 'offset' => false // Not implemented ];
public mixed selectOne(string $dirName, string $fileName, string $extension)
Returns a single template.
Parameters
- string $dirName
- string $fileName
- string $extension
public int update(string $dirName, string $fileName, string $extension, string $content, string $oldFileName=NULL, string $oldExtension=NULL)
Updates an existing template.
Parameters
- string $dirName
- string $fileName
- string $extension
- string $content
- string $oldFileName - Defaults to null
- string $oldExtension - Defaults to null
Inherited public methods
- public self bindEvent($event, $callback, $priority=0) - defined in October\Rain\Halcyon\Datasource\Datasource. Create a new event binding.
- public self bindEventOnce($event, $callback) - defined in October\Rain\Halcyon\Datasource\Datasource. Create a new event binding that fires once only.
- public array fireEvent(string $event, array $params=array(), boolean $halt=false) - defined in October\Rain\Halcyon\Datasource\Datasource. Fire an event and call the listeners.
- public void forceDelete(string $dirName, string $fileName, string $extension) - defined in October\Rain\Halcyon\Datasource\Datasource. Force the deletion of a record against the datasource.
- public October\Rain\Halcyon\Processors\Processor getPostProcessor() - defined in October\Rain\Halcyon\Datasource\Datasource. Get the query post processor used by the connection.
- public self unbindEvent(string $event=NULL) - defined in October\Rain\Halcyon\Datasource\Datasource. Destroys an event binding.
Protected methods
protected string makeFilePath(string $dirName, string $fileName, string $extension)
Helper to make file path.
Parameters
- string $dirName
- string $fileName
- string $extension
Show inherited protected methods
Inherited protected methods
- protected array emitterEventSortEvents(string $eventName) - defined in October\Rain\Halcyon\Datasource\Datasource. Sort the listeners for a given event by priority.