for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Created by PhpStorm.
* User: VITALYIEGOROV
* Date: 09.12.15
* Time: 12:10
*/
namespace samsoncms\api\table;
* SamsonCMS Entity table.
*
* @package samsoncms\api
class Entity extends \samsoncms\api\Entity
{
/** @var int Parent table structure identifier */
protected $structureID;
public function createRow()
// Create row table material
$row = new Material();
$row->parent_id = $this->id;
$row->Active = 1;
$row->save();
// Create row material relation to specific table
$structureMaterial = new NavigationMaterial();
$structureMaterial->MaterialID = $row->id;
$structureMaterial->StructureID = $this->structureID;
$structureMaterial->Active = 1;
$structureMaterial->save();
return $row;
}