Skip to content

Instantly share code, notes, and snippets.

if(isset($id)) {
$row->synchronizeWithArray(array_merge(
$form->getValues(),
array('Author' => $identity)
));
} else {
$row->fromArray($form->getValues());
}
<?php
/*
* $Id$
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
<?php
/**
* Model_Base_Page
*
* This class has been auto-generated by the Doctrine ORM Framework
*
* @property integer $id
* @property integer $author_id
* @property boolean $isPublished
object(Doctrine_Query)[144]
protected '_subqueryAliases' =>
array
empty
protected '_aggregateAliasMap' =>
array
empty
protected '_pendingAggregates' =>
array
empty
array
'select' =>
array
empty
'distinct' => boolean false
'forUpdate' => boolean false
'from' =>
array
empty
'set' =>
<?php
class App_Validate_PasswordConfirmation extends Zend_Validate_Abstract {
const NOT_MATCH = 'notMatch';
protected $_messageTemplates = array(
self::NOT_MATCH => 'Password confirmation does not match'
);
<?php
$passwordConfirmation = new App_Validate_PasswordConfirmation();
$password = $this->addElement('password', 'password', array(
'filters' => array('StringTrim'),
'validators' => array(
$passwordConfirmation,
array('Alnum'),
array('StringLength', false, array(6, 100)),
$this->getHelper('layout')->disableLayout();
$this->getHelper('ViewRenderer')->setNoRender();
$request = $this->getRequest();
if(!$request->isPost()) {
return false;
}
// set the content type
public function newAction() {
$this->getHelper('layout')->disableLayout();
$this->getHelper('ViewRenderer')->setNoRender();
$request = $this->getRequest();
if(!$request->isPost()) {
return false;
}
<?php
class App_Resource_Layouthelpers extends Zend_Application_Resource_ResourceAbstract {
protected $_options = array(
'doctype' => 'XHTML1_STRICT',
'title' => 'Untitled Website',
'title_separator' => ' - ',
'encoding' => 'utf-8',
'content_type' => 'text/html;',