Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7409591
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T06:06:22+00:00 2026-05-29T06:06:22+00:00

CakePHP problems by not getting the _schema my model in cakephp: <?php App::uses(‘AppModel’, ‘Model’);

  • 0

CakePHP problems by not getting the _schema

my model in cakephp:

<?php
App::uses('AppModel', 'Model');
/**
 * Product Model
 *
 * @property Image $Image
 * @property Client $Client
 */
class Product extends AppModel {
/**
 * Display field
 *
 * @var string
 */
    public $displayField = 'title';


}
?>

My controller in cakephp:

$this->Product->recursive = -1;
var_dump($this->Product->_schema);

var_dump gives me null

I do the same with another table in BBDD and get results.

Results another table in BBDD:

Array
(
    [id] => Array
        (
            [type] => integer
            [null] => 
            [default] => 
            [length] => 11
            [key] => primary
            [collate] => 
            [comment] => 
        )

    [type] => Array
        (
            [type] => integer
            [null] => 
            [default] => 
            [length] => 11
            [collate] => 
            [comment] => 
        )

    [title] => Array
        (
            [type] => string
            [null] => 
            [default] => 
            [length] => 255
            [collate] => utf8_general_ci
            [comment] => 
            [charset] => utf8
        )

    [description] => Array
        (
            [type] => text
            [null] => 
            [default] => 
            [length] => 
            [collate] => utf8_general_ci
            [comment] => 
            [charset] => utf8
        )

    [date] => Array
        (
            [type] => date
            [null] => 
            [default] => 
            [length] => 
            [collate] => 
            [comment] => 
        )

    [urlvideo] => Array
        (
            [type] => string
            [null] => 
            [default] => 
            [length] => 255
            [collate] => utf8_general_ci
            [comment] => 
            [charset] => utf8
        )

    [image] => Array
        (
            [type] => string
            [null] => 
            [default] => 
            [length] => 255
            [collate] => utf8_general_ci
            [comment] => 
            [charset] => utf8
        )

    [created] => Array
        (
            [type] => datetime
            [null] => 
            [default] => 
            [length] => 
            [collate] => 
            [comment] => 
        )

    [modified] => Array
        (
            [type] => datetime
            [null] => 
            [default] => 
            [length] => 
            [collate] => 
            [comment] => 
        )

)

thanks

PD:

my table:

CREATE TABLE `products` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `title` varchar(150) NOT NULL,
  `description` text,
  `characteristics` text,
  `urlvideo` varchar(255) DEFAULT NULL,
  `pdf` varchar(255) NOT NULL,
  `type` int(11) NOT NULL,
  `created` datetime NOT NULL,
  `modified` datetime NOT NULL,
  PRIMARY KEY (`id`)
) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=4 ;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T06:06:23+00:00Added an answer on May 29, 2026 at 6:06 am

    ->_schema stores a cached copy of the schema of a model. If you haven’t run any queries on the model, it will be empty.

    Try calling:

    $this->Model->schema()
    

    (which fetches the schema, caches it in Model->_schema, and then returns the data)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In a CakePHP 1.2 app, I'm using <?php $session->flash();?> to output messages like Record
I'm trying to use Ajax in CakePHP, and not really getting anywhere! I have
I am using CakePHP and getting the following error Warning: Cache not configured properly.
One thing with which I have long had problems, within the CakePHP framework, is
I have problem with session in cakephp.I have one file chat.php that is in
Cakephp is giving me some problems as I have set as below (I have
I need to add new functionalities into /cake/libs/controller/pages_controller.php but I do not want to
I'm developping an application with CakePHP and I'm experiencing some problems with my DB.
I have two applications in CakePHP, App A an App B. I want that
in cakebook on page http://book.cakephp.org/view/1331/Defining-the-Fields there is a sentence what I am not able

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.