Overview

Namespaces

  • Charcoal
    • Loader
    • Model
      • Service
      • ServiceProvider
    • Source
      • Database
    • Validator

Classes

  • Charcoal\Loader\CollectionLoader
  • Charcoal\Loader\FileLoader
  • Charcoal\Model\AbstractMetadata
  • Charcoal\Model\AbstractModel
  • Charcoal\Model\Collection
  • Charcoal\Model\Model
  • Charcoal\Model\ModelMetadata
  • Charcoal\Model\ModelValidator
  • Charcoal\Model\Service\MetadataLoader
  • Charcoal\Model\Service\ModelBuilder
  • Charcoal\Model\Service\ModelLoader
  • Charcoal\Model\Service\ModelLoaderBuilder
  • Charcoal\Model\ServiceProvider\ModelServiceProvider
  • Charcoal\Source\AbstractSource
  • Charcoal\Source\Database\DatabaseFilter
  • Charcoal\Source\Database\DatabaseOrder
  • Charcoal\Source\Database\DatabasePagination
  • Charcoal\Source\DatabaseSource
  • Charcoal\Source\DatabaseSourceConfig
  • Charcoal\Source\Filter
  • Charcoal\Source\Order
  • Charcoal\Source\Pagination
  • Charcoal\Source\SourceConfig
  • Charcoal\Validator\AbstractValidator
  • Charcoal\Validator\ValidatorResult

Interfaces

  • Charcoal\Model\CollectionInterface
  • Charcoal\Model\DescribableInterface
  • Charcoal\Model\MetadataInterface
  • Charcoal\Model\ModelInterface
  • Charcoal\Source\DatabaseSourceInterface
  • Charcoal\Source\FilterInterface
  • Charcoal\Source\OrderInterface
  • Charcoal\Source\PaginationInterface
  • Charcoal\Source\SourceInterface
  • Charcoal\Source\StorableInterface
  • Charcoal\Validator\ValidatableInterface
  • Charcoal\Validator\ValidatorInterface

Traits

  • Charcoal\Model\DescribableTrait
  • Charcoal\Source\StorableTrait
  • Charcoal\Validator\ValidatableTrait
  • Overview
  • Namespace
  • Class
 1: <?php
 2: 
 3: namespace Charcoal\Source;
 4: 
 5: use \InvalidArgumentException;
 6: 
 7: // Dependency from 'charcoal-config'
 8: use \Charcoal\Config\AbstractConfig as AbstractConfig;
 9: 
10: /**
11:  * Source Config
12:  */
13: class SourceConfig extends AbstractConfig
14: {
15:     /**
16:      * @var string $type
17:      */
18:     private $type;
19: 
20:     /**
21:      * @return array
22:      */
23:     public function defaults()
24:     {
25:         return [
26:             'type' => ''
27:         ];
28:     }
29: 
30:     /**
31:      * @param string $type The type of source.
32:      * @throws InvalidArgumentException If parameter is not a string.
33:      * @return SourceConfig Chainable
34:      */
35:     public function setType($type)
36:     {
37:         if (!is_string($type)) {
38:             throw new InvalidArgumentException(
39:                 'Source type must be a string.'
40:             );
41:         }
42:         $this->type = $type;
43:         return $this;
44:     }
45: 
46:     /**
47:      * @return string
48:      */
49:     public function type()
50:     {
51:         return $this->type;
52:     }
53: }
54: 
API documentation generated by ApiGen