Skip to content

Commit aa5fcd5

Browse files
committed
rm Entity
1 parent 4bc1272 commit aa5fcd5

File tree

4 files changed

+1
-344
lines changed

4 files changed

+1
-344
lines changed

README.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ Lark is a modern, lightweight app framework designed specifically for developing
2121
- [Validator](#validator)
2222
- [Validation Types & Rules](#validation-types--rules)
2323
- [Filter](#filter)
24-
- [Entity](#entity)
2524
- [HTTP Client](#http-client)
2625
- [CLI](#cli)
2726
- [File](#file)
@@ -1927,48 +1926,6 @@ print_r(
19271926
- `string($value, array $options = ['flags' => FILTER_FLAG_STRIP_LOW | FILTER_FLAG_STRIP_HIGH]): string` - sanitize value with string filter
19281927
- `url($value, array $options = []): string` - sanitize value with url filter
19291928

1930-
## Entity
1931-
1932-
`Lark\Factory\Entity` is used for mapping class properties to array and array to class properties.
1933-
1934-
```php
1935-
use Lark\Factory\Entity;
1936-
1937-
// class must be subclass of Entity
1938-
class Location extends Entity
1939-
{
1940-
public string $address;
1941-
public string $city;
1942-
}
1943-
1944-
class User extends Entity
1945-
{
1946-
// properties must be public and typed
1947-
// union types are not supported
1948-
public string $name;
1949-
public int $age;
1950-
public bool $isActive = false; // default values
1951-
public Location $location; // deep nested classes supported
1952-
}
1953-
1954-
// populate from array
1955-
$user = new User([
1956-
'name' => 'Bob',
1957-
'age' => 25,
1958-
'location' => [
1959-
'address' => '101 main',
1960-
'city' => 'Tampa'
1961-
]
1962-
]);
1963-
// or use: $user->fromArray([...])
1964-
1965-
echo $user->name; // Bob
1966-
echo $user->location->address; // 101 main
1967-
1968-
// get as array
1969-
$userArr = $user->toArray(); // [name => Bob, ...]
1970-
```
1971-
19721929
## HTTP Client
19731930

19741931
`Lark\Http\Client` is an HTTP client.

src/Lark/Factory/Entity.php

Lines changed: 0 additions & 280 deletions
This file was deleted.

src/Lark/Factory/EntityException.php

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/Lark/release.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@
77
* @link <https://github.com/shayanderson/lark-framework>
88
*/
99

10-
const LARK_RELEASE = '0.25.0';
10+
const LARK_RELEASE = '0.26.0';

0 commit comments

Comments
 (0)