Skip to content

Commit 175675a

Browse files
committed
feat: updates Model to use new property structure
1 parent 8c138e4 commit 175675a

File tree

5 files changed

+395
-248
lines changed

5 files changed

+395
-248
lines changed

src/Models/Contracts/Model.php

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
namespace StellarWP\Models\Contracts;
44

55
use RuntimeException;
6+
use StellarWP\Models\ModelPropertyDefinition;
67

78
interface Model extends ModelBuildsFromData {
89
/**
@@ -58,6 +59,25 @@ public function getDirty() : array;
5859
*/
5960
public function getOriginal( string $key = null );
6061

62+
/**
63+
* Returns the property definition for the given key.
64+
*
65+
* @since 2.0.0
66+
*
67+
* @param string $key Property name.
68+
*
69+
* @return ModelPropertyDefinition
70+
*/
71+
public static function getPropertyDefinition( string $key ) : ModelPropertyDefinition;
72+
73+
/**
74+
* Returns the property definitions for the model.
75+
*
76+
* @since 2.0.0
77+
* @return array<string,ModelPropertyDefinition>
78+
*/
79+
public static function getPropertyDefinitions() : array;
80+
6181
/**
6282
* Determines if the model has the given property.
6383
*

0 commit comments

Comments
 (0)