Skipper - The ORM Designer Blog
  • Skipper - The ORM Designer
  • VsBuilds - Parallel building
  • Pulpo - Free Skipper CLI

Tag: #cakephp

Interesting resources for PHP, ORM and MVC programmers

We asked our developers, who to follow or what to monitor on social networks and where they find new tips and current topics in their field of interest. Based on their references we compiled a following** list of interesting people and accounts** of various PHP frameworks or debating communities for selected social networks:

Who to follow on Twitter

  • Zend Technologies – 26 000 followers The primary sponsor of the Zend Framework open source project for developing web applications and services using PHP
  • Andi Gutmans – 4 553 followers An Israeli PHP developer and co-founder of Zend Technologies
  • Symfony – 13 600 followers An Open Source distributed PHP framework
  • Fabien Potencier – 18 700 followers Symfony founder and project lead
  • Cakephp – 10 600 followers An open source web application framework which follows the Model-View-Controller (MVC) approach and is written in PHP
  • Larry E. Masters – 2212 followers CakePHP Founder/Lead Developer
  • James Watts – 204 followers CakePHP Core Member and Community Manager
  • Doctrine project – 1 403 fllowers An object-relational mapping (ORM) tool for PHP application development
  • Benjamin Eberlei – 2 890 followers Doctrine project lead and IT-Consultant for quality assurance and software architecture
  • Rasmus Lerdorf – 28 700 followers Famous for creating the PHP scripting language, authoring the first two versions of the language and participating in development of later versions

Interesting groups on LinkedIn

Where to talk on Facebook

Facebook is designed more for entertainment than professional discussion. However, there is one active group where you can discuss topics about your field of interest:

  • PHP – 18 720 members

Communities to join on Google+

Do you use social networks? Which ones? Do you miss someone or something in the list? Feel free to discuss it in comments.

New feature for CakePHP users – DB Schema export

Today I would like to introduce you a new upcoming feature for CakePHP users. Nowadays ORM Designer can export php classes for your model objects. But when you want to use CakePHP migrations, you have to make the DB changes manually. This would change in the next ORM Designer release. Besides model classes ORM Designer knows how to generate CakeSchema (http://book.cakephp.org/2.0/en/console-and-shells/schema-management-and-migrations.html) object class which defines a whole DB structure.

Usage of this new function is very simple. In your current ORM Designer model choose “Project object”

CakePHP schema management and migrations

In Project property window there is a new item Schema with child export-file.  Select “export-file” property and click on the button with three dots and choose export file for schema file.

Export CakePHP schema file

Now, if you export your model by using “Export to ORM” button, beside the model object files DB schema file will be also generated.

For our example DB schema file will look like this:

<?php
/* SVN FILE: $Id$ */
/* App schema generated by: ORM Designer (http://www.orm-designer.com) */
class AppSchema extends CakeSchema
{
  public $name = 'App';
  public $Contact =
    array (
      'ID' =>
        array (
          'type' => 'integer',
          'null' => 'true',
          'default' => 'NULL',
          'key' => 'primary',
          'length' => '4'
        ),
      'Name' =>
        array (
          'type' => 'string',
          'null' => 'true',
          'default' => 'NULL'
        ),
      'Age' =>
        array (
          'type' => 'integer',
          'null' => 'true',
          'default' => 'NULL'
        ),
      'indexes' =>
        array (
          'PRIMARY' =>
            array (
              'column' => 'ID'
            )
        )
    );
}

Note: This feature will be available in 1.4.0.420 and later.

05 Aug 2010

Support of CakePHP validators in ORM Designer

Today we finished beta support of CakePHP validators in ORM Designer. Thanks to Stefano Manfredini for giving us the idea and testing this new feature. You will find this new feature in upcoming ORM Designer 1.4.0 version build 417 and later.

Screenshot of testing model with entered validators:

Detailed screenshot to all supported validators in ORM Designer:

How to use it

If you want to add a validator to any field in your model, follow next instructions:

  1. Select the field where you want to define new data validation.
  2. In ORM Property window click on Validator item ->  ”Add Item”.
  3. After clicking on “Add Item”, the window with all supported validators appear. Choose the required validator and press OK.
  4. After selecting validator from the list, you can add some additional parameters.  You can do this by selecting  added validator and entering value to the correspond property.

After you enter all required validators, you can “Export” them to base class.

And it’s done. No more complicated and confused array definitions, simple design it in ORM Designer ;-)

List of currently supported validators include their parameters:

  • alphaNumeric
  • between
    • minimum
    • maximum
  • blank
  • boolean
  • cc
    • type
    • deep
    • regex
  • comparison
    • operator
    • value
  • date
    • format
  • decimal
    • decimal
  • email
    • validate-host
  • equalTo
    • value
  • extension
    • value
  • ip
  • isUnique
  • minLength
    • value
  • maxLength
    • value
  • money
    • position
  • multiple
    • in
    • min
    • max
  • inList
    • values
  • numeric
  • notEmpty
  • phone
    • reg-ex
    • country
  • postal
    • reg-ex
    • country
  • range
    • minimum
    • maximum
  • ssn
    • reg-ex
    • country
  • url
    • strict
  • reg-ex
    • regex
  • own-function
    • name
    • params

All validators have folllowing commont properties:

  • name: Rule name used in definition array when field has multiple validators
  • required: Require flag, for more information follow CakePHP documentation.
  • allowEmpty: AllowEmpty flagfor more information follow CakePHP documentation.
  • on: Validator type. Can be NULL/create/update. For more information follow CakePHP documentation.
  • message: Error message for the rule.For more information follow CakePHP documentation.
  • last: Flag used when one field have multiple validators. More information about last flag in CakePHP documentation .
18 Jul 2010