### Usage
Get an article and some relationships:
$article = $articles->get(1, ['contain' => ['Users', 'Comments']]);
public get ( $primaryKey, $options = [] ) |
// Load the User table instance $Users = TableRegistry::getTableLocator()->get('Users'); // Retrieve the user record with ID=1 $user = $Users->get(1); // Print the user's name echo $user->name;
// Load the BlogPosts table instance $BlogPosts = TableRegistry::getTableLocator()->get('BlogPosts'); // Retrieve the blog post record with 'example-slug' slug $post = $BlogPosts->get('example-slug', ['slug']); // Print the post's title echo $post->title;The package library for this code is CakePHP - a popular PHP web application framework that follows the MVC (Model-View-Controller) architectural pattern. The ORM (Object-Relational Mapping) component is responsible for handling database interactions and provides convenient APIs for developers to write database queries in a more object-oriented way.
public get ( $primaryKey, $options = [] ) |