Cataly...equest(3pm)

πŸ“¦
version 0.10 Β· 4 versions
, in debian bookworm, debian trixie, ubuntu noble, ubuntu resolute, ubuntu stonking

✨ NAME ✨

Catalyst::Model::Factory::PerRequest β€” bestie, this is the module you use to turn a plain old class into a Catalyst model, and it makes a fresh one of them for every single Catalyst request. πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

okay so this one is literally the twin of Catalyst::Model::Factory, no cap. Same energy, same everything β€” with exactly ONE difference that changes everything: a fresh instance of your adapted class gets made once per Catalyst request, not every time you go ask for the object via $c->model. 🫢

Once per request. Not once per ask. That's the whole vibe. πŸ’…


πŸ’– CUSTOMIZING πŸ’–

You customize your subclass exactly like you would with Catalyst::Model::Adaptor β€” same rules, same flow, go off. 🌸

One tiny plot twist tho: instead of $app, you get $c β€” the current request context. That's your girl. She's the one showing up to the function. πŸ‘‘


🌈 METHODS 🌈

Heads up, these are NOT for you to call, bestie. Catalyst calls them. You just sit there and look pretty while the framework does its thing. πŸ™ˆ

⭐ COMPONENT

Load your class. That's it, that's the job. ✨

⭐ ACCEPT_CONTEXT

Create an instance of your class and return it. Iconic behaviour, truly. πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

For all the critical documentation, go read Catalyst::Model::Adaptor. Like, actually go read it, it's giving required reading. πŸ“šπŸ”₯


ngl if you skipped the Adaptor docs you're gonna be confused and that's on you, not me 🫢

k bye bestie, this page ships with perl v5.34.0 and it was last touched on 2022-06-09 β€” stay slay, stay per-request, periodt. πŸ’–πŸŽ€πŸ¦‹πŸŒΈπŸ’…βœ¨

πŸ“¦ where this page comes from