Overview

Namespaces

  • rsanchez
    • Deep
      • App
        • EE
        • Laravel
          • Facade
      • Collection
      • Hydrator
      • Model
      • Plugin
      • Relations
      • Repository

Classes

  • AbstractEntity
  • AbstractField
  • AbstractProperty
  • Asset
  • Category
  • CategoryField
  • CategoryPosts
  • Channel
  • Comment
  • Entry
  • Field
  • Fieldtype
  • File
  • GridCol
  • GridRow
  • JoinableScope
  • MatrixCol
  • MatrixRow
  • Member
  • MemberField
  • PlayaEntry
  • RelationshipEntry
  • Site
  • Title
  • UploadPref

Interfaces

  • FileInterface

Traits

  • GlobalAttributeVisibilityTrait
  • JoinableTrait
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: 
 3: /**
 4:  * Deep
 5:  *
 6:  * @package      rsanchez\Deep
 7:  * @author       Rob Sanchez <info@robsanchez.com>
 8:  */
 9: 
10: namespace rsanchez\Deep\Model;
11: 
12: use Illuminate\Database\Eloquent\Model;
13: use Illuminate\Database\Eloquent\Builder;
14: use rsanchez\Deep\Model\AbstractProperty;
15: use rsanchez\Deep\Collection\MatrixColCollection;
16: 
17: /**
18:  * Model for the matrix_cols table
19:  */
20: class MatrixCol extends AbstractProperty
21: {
22:     /**
23:      * {@inheritdoc}
24:      *
25:      * @var string
26:      */
27:     protected $table = 'matrix_cols';
28: 
29:     /**
30:      * {@inheritdoc}
31:      *
32:      * @var string
33:      */
34:     protected $primaryKey = 'col_id';
35: 
36:     /**
37:      * Filter by Field ID
38:      *
39:      * @param  \Illuminate\Database\Eloquent\Builder $query
40:      * @param  int|array                             $fieldId
41:      * @return \Illuminate\Database\Eloquent\Builder
42:      */
43:     public function scopeFieldId(Builder $query, $fieldId)
44:     {
45:         $fieldId = is_array($fieldId) ? $fieldId : array($fieldId);
46: 
47:         return $this->whereIn('field_id', $fieldId);
48:     }
49: 
50:     /**
51:      * {@inheritdoc}
52:      *
53:      * @param  array                                         $models
54:      * @return \rsanchez\Deep\Collection\MatrixColCollection
55:      */
56:     public function newCollection(array $models = array())
57:     {
58:         return new MatrixColCollection($models);
59:     }
60: 
61:     /**
62:      * {@inheritdoc}
63:      */
64:     public function getName()
65:     {
66:         return $this->col_name;
67:     }
68: 
69:     /**
70:      * {@inheritdoc}
71:      */
72:     public function getIdentifier()
73:     {
74:         return 'col_id_'.$this->col_id;
75:     }
76: 
77:     /**
78:      * {@inheritdoc}
79:      */
80:     public function getId()
81:     {
82:         return $this->col_id;
83:     }
84: 
85:     /**
86:      * {@inheritdoc}
87:      */
88:     public function getType()
89:     {
90:         return $this->col_type;
91:     }
92: }
93: 
API documentation generated by ApiGen 2.8.0