protected function addFindOneBySlug(&$script) { $script .= "\n/**\n * Find one object based on its slug\n *\n * @param string \$slug The value to use as filter.\n * @param ConnectionInterface \$con The optional connection object\n *\n * @return " . $this->builder->getObjectClassName() . " the result, formatted by the current formatter\n */\npublic function findOneBySlug(\$slug, \$con = null)\n{\n return \$this->filterBySlug(\$slug)->findOne(\$con);\n}\n"; }
public function objectAttributes(ObjectBuilder $builder) { $tableName = $this->table->getName(); $objectClassName = $builder->getObjectClassName(); $script = "\n/**\n * Queries to be executed in the save transaction\n * @var array\n */\nprotected \$nestedSetQueries = array();\n\n/**\n * Internal cache for children nodes\n * @var null|ObjectCollection\n */\nprotected \$collNestedSetChildren = null;\n\n/**\n * Internal cache for parent node\n * @var null|{$objectClassName}\n */\nprotected \$aNestedSetParent = null;\n\n/**\n * Left column for the set\n */\nconst LEFT_COL = '" . $tableName . '.' . $this->behavior->getColumnConstant('left_column') . "';\n\n/**\n * Right column for the set\n */\nconst RIGHT_COL = '" . $tableName . '.' . $this->behavior->getColumnConstant('right_column') . "';\n\n/**\n * Level column for the set\n */\nconst LEVEL_COL = '" . $tableName . '.' . $this->behavior->getColumnConstant('level_column') . "';\n"; if ($this->behavior->useScope()) { $script .= "\n/**\n * Scope column for the set\n */\nconst SCOPE_COL = '" . $tableName . '.' . $this->behavior->getColumnConstant('scope_column') . "';\n"; } return $script; }