Add daily email
This commit is contained in:
parent
7dcc7a2126
commit
6e7a40976b
3 changed files with 131 additions and 0 deletions
|
@ -6528,5 +6528,12 @@
|
|||
],
|
||||
"path_alias.4f75055d-c9c3-4f31-9a7c-12f6566d1545": [
|
||||
"node.c337a375-7fec-45d9-ad89-60ece71c2194"
|
||||
],
|
||||
"node.3c851569-9655-4936-aed7-6f965aa6b4d1": [
|
||||
"user.b8966985-d4b2-42a7-a319-2e94ccfbb849",
|
||||
"node.9b4c39a3-702f-486c-a79b-4d7b96a4f3f6"
|
||||
],
|
||||
"path_alias.646abc92-dd73-4152-852e-d1e498000abe": [
|
||||
"node.3c851569-9655-4936-aed7-6f965aa6b4d1"
|
||||
]
|
||||
}
|
97
content/node.3c851569-9655-4936-aed7-6f965aa6b4d1.json
Normal file
97
content/node.3c851569-9655-4936-aed7-6f965aa6b4d1.json
Normal file
|
@ -0,0 +1,97 @@
|
|||
{
|
||||
"uuid": [
|
||||
{
|
||||
"value": "3c851569-9655-4936-aed7-6f965aa6b4d1"
|
||||
}
|
||||
],
|
||||
"langcode": [
|
||||
{
|
||||
"value": "en"
|
||||
}
|
||||
],
|
||||
"type": [
|
||||
{
|
||||
"target_id": "daily_email",
|
||||
"target_type": "node_type",
|
||||
"target_uuid": "8bde1f2f-eef9-4f2d-ae9c-96921f8193d7"
|
||||
}
|
||||
],
|
||||
"revision_timestamp": [
|
||||
{
|
||||
"value": "2025-06-26T11:59:55+00:00"
|
||||
}
|
||||
],
|
||||
"revision_uid": [
|
||||
{
|
||||
"target_type": "user",
|
||||
"target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849"
|
||||
}
|
||||
],
|
||||
"revision_log": [],
|
||||
"status": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"uid": [
|
||||
{
|
||||
"target_type": "user",
|
||||
"target_uuid": "b8966985-d4b2-42a7-a319-2e94ccfbb849"
|
||||
}
|
||||
],
|
||||
"title": [
|
||||
{
|
||||
"value": "Giving things descriptive names"
|
||||
}
|
||||
],
|
||||
"created": [
|
||||
{
|
||||
"value": "2025-06-23T11:30:14+00:00"
|
||||
}
|
||||
],
|
||||
"changed": [
|
||||
{
|
||||
"value": "2025-06-26T11:59:55+00:00"
|
||||
}
|
||||
],
|
||||
"promote": [
|
||||
{
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
"sticky": [
|
||||
{
|
||||
"value": false
|
||||
}
|
||||
],
|
||||
"default_langcode": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"revision_translation_affected": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"alias": "\/daily\/2025\/06\/23\/giving-things-descriptive-names",
|
||||
"langcode": "en"
|
||||
}
|
||||
],
|
||||
"body": [
|
||||
{
|
||||
"value": "An approach I like to use when writing code is value objects, and it was great to see a recent talk by Dan Leech (past guest on the [Beyond Blocks podcast][podcast]) about them at a recent PHP meetup.\r\n\r\nTo quote from Dan's talk - \"value objects are objects that represent a value\".\r\n\r\nThey are simple classes that give a meaningful name to a value.\r\n\r\nFor example, I could write this value object to represent a railway station code:\r\n\r\n```php\r\nreadonly final class StationCode {\r\n\r\n public function __construct(public string $value) {\r\n assert(strlen($value) === 3);\r\n }\r\n\r\n}\r\n```\r\n\r\nNow, instead of referencing a generic `string` type, I can reference a `StationCode` object.\r\n\r\nThis makes the code more readable and easier to understand.\r\n\r\nIn this case, I can also validate the string is in the correct format so I know that anywhere a `StationCode` object is used, its values are the correct format and this is done in a single place.\r\n\r\nI can also take this a step further and introduce a `Journey` value object that represents a journey between two stations:\r\n\r\n```\r\nreadonly final class Journey {\r\n\r\n public function __construct(\r\n public StationCode $origin,\r\n public StationCode $destination,\r\n ) {\r\n }\r\n\r\n}\r\n```\r\n\r\nIn this case, a journey always has two stations - an origin and a destination.\r\n\r\nCreating an object to represent this gives it a name, but also prevents data clumping - where groups of variables are passed around together.\r\n\r\nThese are two examples from my recent code, but I could find many others.\r\n\r\nAnd that's one reason why I like value objects - they are so easy and quick to use.\r\n\r\nIf you haven't before, try introducing value objects into your code.\r\n\r\nIf you already do, reply and tell me about some of the use cases you've found for them.\r\n\r\nYou can see the slides from Dan's presentation at <https:\/\/www.dantleech.com\/slides\/2025\/dpc-php-value-objects-and-you\/presentation.html>.\r\n\r\n[podcast]: \/podcast\/6-dan-leech-php-tui",
|
||||
"format": "markdown",
|
||||
"processed": "<p>An approach I like to use when writing code is value objects, and it was great to see a recent talk by Dan Leech (past guest on the <a href=\"http:\/\/localhost:8888\/podcast\/6-dan-leech-php-tui\">Beyond Blocks podcast<\/a>) about them at a recent PHP meetup.<\/p>\n<p>To quote from Dan's talk - \"value objects are objects that represent a value\".<\/p>\n<p>They are simple classes that give a meaningful name to a value.<\/p>\n<p>For example, I could write this value object to represent a railway station code:<\/p>\n<pre><code>readonly final class StationCode {\n\n public function __construct(public string $value) {\n assert(strlen($value) === 3);\n }\n\n}\n<\/code><\/pre><p>Now, instead of referencing a generic <code>string<\/code> type, I can reference a <code>StationCode<\/code> object.<\/p>\n<p>This makes the code more readable and easier to understand.<\/p>\n<p>In this case, I can also validate the string is in the correct format so I know that anywhere a <code>StationCode<\/code> object is used, its values are the correct format and this is done in a single place.<\/p>\n<p>I can also take this a step further and introduce a <code>Journey<\/code> value object that represents a journey between two stations:<\/p>\n<pre><code>readonly final class Journey {\n\n public function __construct(\n public StationCode $origin,\n public StationCode $destination,\n ) {\n }\n\n}\n<\/code><\/pre><p>In this case, a journey always has two stations - an origin and a destination.<\/p>\n<p>Creating an object to represent this gives it a name, but also prevents data clumping - where groups of variables are passed around together.<\/p>\n<p>These are two examples from my recent code, but I could find many others.<\/p>\n<p>And that's one reason why I like value objects - they are so easy and quick to use.<\/p>\n<p>If you haven't before, try introducing value objects into your code.<\/p>\n<p>If you already do, reply and tell me about some of the use cases you've found for them.<\/p>\n<p>You can see the slides from Dan's presentation at <a href=\"https:\/\/www.dantleech.com\/slides\/2025\/dpc-php-value-objects-and-you\/presentation.html\">https:\/\/www.dantleech.com\/slides\/2025\/dpc-php-value-objects-and-you\/presentation.html<\/a>.<\/p>\n",
|
||||
"summary": ""
|
||||
}
|
||||
],
|
||||
"field_daily_email_cta": [
|
||||
{
|
||||
"target_type": "node",
|
||||
"target_uuid": "9b4c39a3-702f-486c-a79b-4d7b96a4f3f6"
|
||||
}
|
||||
]
|
||||
}
|
27
content/path_alias.646abc92-dd73-4152-852e-d1e498000abe.json
Normal file
27
content/path_alias.646abc92-dd73-4152-852e-d1e498000abe.json
Normal file
|
@ -0,0 +1,27 @@
|
|||
{
|
||||
"uuid": [
|
||||
{
|
||||
"value": "646abc92-dd73-4152-852e-d1e498000abe"
|
||||
}
|
||||
],
|
||||
"langcode": [
|
||||
{
|
||||
"value": "en"
|
||||
}
|
||||
],
|
||||
"path": [
|
||||
{
|
||||
"value": "\/node\/3c851569-9655-4936-aed7-6f965aa6b4d1"
|
||||
}
|
||||
],
|
||||
"alias": [
|
||||
{
|
||||
"value": "\/daily\/2025\/06\/23\/giving-things-descriptive-names"
|
||||
}
|
||||
],
|
||||
"status": [
|
||||
{
|
||||
"value": true
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue