mbo2olivier / mukadi-doctrine-crud Goto Github PK
View Code? Open in Web Editor NEWA simple CRUD Helper for Doctrine Managed entities.
A simple CRUD Helper for Doctrine Managed entities.
I'm using Mukadi Symfony and WordPress bundle and have everything running properly locally. My next step is to pull some posts from the database using Mukadi Doctrine CRUD, but when I make the call it appears nothing is being returned. I've created the constructor like this
use Mukadi\WordpressBundle\Manager\PostManager;
private $manager;
public function __construct(PostManager $manager)
{
$this->manager = $manager;
}
but then I was getting autowiring error, so I added alias within services.yaml and error disappeared, like this
...
Mukadi\WordpressBundle\Manager\PostManager: '@mukadi_wordpress.manager.post'
and now when the default page loads, I want to grab post with ID = 1.
/**
* @Route("/", name="default_index")
*/
public function index()
{
$post1 = $this->manager->get(1);
return new JsonResponse(
[
'action' => 'index',
'post' => $post1
]);
}
When I return this, I am getting empty object even though a post with ID = 1 exists in database. What connection can be missing? Later on, I modified a piece of the CRUD.php file to create a method that returns all of the posts in the database. Upon doing this, the JSON response contained an array of 10 empty objects, the amount of posts I have in the database. I added one more post as sanity check and refreshed and the count in the response updated. So, I am connected... but why are objects empty?
Hi @mbo2olivier,
Is it possible to use your bundle with WP ACF plugin?
If yes, how?
Thanks by advance for your feedback.
Kind regards.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.