πŸ‡ΊπŸ‡ΈUnited States @sunset_bill

Account created on 20 April 2008, over 16 years ago
#

Recent comments

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

I get the same warnings from memcache_storage.install() in Docker on my local. It looks like the problem is that memcached isn't running, so memcache_storage doesn't get a connection, which leads to other problems.

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Remove mention of Nodes.

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Improve documentation for DB tabled

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Improve bundle class documentation

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Improve documentation about the add form annotation.

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Finally got all the pieces working, and documented it here.

https://www.drupal.org/docs/create-custom-content-types-with-bundle-classes β†’

IRL:  We're using these for content types at Warner Bros Discovery.  We just finished migrating dc.com from a D7 site to our D9 platform, where we implemented bundle classes for each of their content types.  It's working out very well.  One of the coolest things about them is that part of our workflow is that when content is created/edited, we need to publish the changes to GraphQL, so our content entity class and bundle classes have their own `normalize()` methods.  So, when we save an entity, we can just call `$entity->normalize()` and pass the result along to our GraphQL publisher.  It's lot handier than having a separate normalizer class for each type.

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Correction to the `Create a bundle class` section.

πŸ‡ΊπŸ‡ΈUnited States sunset_bill

Hey @johnfallen, yeah, after a couple days with the debugger.  It's this bit in the `links` section of your entity type annotation:

 *     // Drush generate puts 'my_content_entity' as the parameter here.  
 *     // It needs to be 'bundle' in order to get a blank Add form for your
 *     // content type. 
 *     "add-form" = "/my_entity_type/add/{bundle}",

I wrote up a doc for the whole thing, but it's waiting on the process to (hopefully) get published:

https://www.drupal.org/docs/create-custom-content-types-with-bundle-classes β†’

Production build 0.71.5 2024