1 | <?php |
||
20 | abstract class WordPoints_Entity_Attr |
||
21 | extends WordPoints_Entityish |
||
22 | implements WordPoints_Entity_ChildI { |
||
23 | |||
24 | /** |
||
25 | * The data type of the values of this attribute. |
||
26 | * |
||
27 | * @since 1.0.0 |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $data_type; |
||
32 | |||
33 | /** |
||
34 | * Get the value of this attribute from an entity. |
||
35 | * |
||
36 | * @since 1.0.0 |
||
37 | * |
||
38 | * @param WordPoints_Entity $entity The entity. |
||
39 | * |
||
40 | * @return mixed The attribute value. |
||
41 | */ |
||
42 | abstract protected function get_attr_value_from_entity( WordPoints_Entity $entity ); |
||
43 | |||
44 | /** |
||
45 | * Get the data type of this attribute's values. |
||
46 | * |
||
47 | * @since 1.0.0 |
||
48 | * |
||
49 | * @return string The data type of this attribute's values. |
||
50 | */ |
||
51 | public function get_data_type() { |
||
54 | |||
55 | /** |
||
56 | * Set the value of this attribute from an entity. |
||
57 | * |
||
58 | * This class can represent either a type of attribute generically (e.g., Post |
||
59 | * title) or a specific value of that attribute (the title of a specific Post). |
||
60 | * This method is used to set a specific value for the attribute this object |
||
61 | * should represent. |
||
62 | * |
||
63 | * @since 1.0.0 |
||
64 | * |
||
65 | * @param WordPoints_Entity $entity An entity object. |
||
66 | * |
||
67 | * @return bool Whether the value was set correctly. |
||
68 | */ |
||
69 | public function set_the_value_from_entity( WordPoints_Entity $entity ) { |
||
75 | } |
||
76 | |||
78 |