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 6069031
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T09:46:43+00:00 2026-05-23T09:46:43+00:00

So I just started learning to use ORM, went with Jelly when I first

  • 0

So I just started learning to use ORM, went with Jelly when I first started learning Ko3, and have run into a few questions… they may seem stupid so please bear with me.

First I noticed that declaring the Model is enough to start using it, without having to break down the fields. Is this some automagic I’m unaware of? If so… does it cause performance issues and should it be avoided?

I’ve also noticed two different ways of declaring rules… what’s the difference between these two methods?

public function rules() {
    return array(
        'categoryname' => array(
            array('not_empty'),
        ),
    );
}

protected $_rules = array(
    'categoryname' => array(
        'not_empty' => true,
    ),
);
  • 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-23T09:46:43+00:00Added an answer on May 23, 2026 at 9:46 am
    1. Yes, ORM will automatically call SHOW COLUMNS on empty model. But you can simply cache it.
    2. rules() was added in Kohana 3.1 (3.0 uses $_rules property). Now you can apply some logic before return rule list. And its better for model extending, for example:
    public function rules()
    {
        return parent::rules() + array('foo' => 'bar');
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Hi Just started learning c for uni (usually use objective c) and have run
I have just started learning UML and after completing use case I've just started
I have just started learning PHP, and here's my first doubt... Both of these
I've just started learning to use Core Data. On my first attempt to add
I just started learning about ASP.NET, and I have a couple of questions. Am
I just started learning objective c. I have this little problems and questions, hope
I just started learning Common Lisp a few days ago, and I'm trying to
I've just started learning linq and lambda expressions, and they seem to be a
I have just started learning Erlang and am trying out some Project Euler problems
I'm stil pretty new to regular expression and just started learning to use awk.

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.