public function automaticParentId($data)
	{
		if (!isset($data['parent_id']))
		{
			$data['parent_id'] = 0;
		}

		if ((!isset($data['id']) || !$data['id'])
		 && ($data['parent_id'] == 0))
		{
			$data['parent_id'] = self::getRootId();
		}

		return $data['parent_id'];
	}
public function automaticParentId($data)
	{
		if (!isset($data['parent_id']))
		{
			$data['parent_id'] = 0;
		}

		if ((!isset($data['id']) || !$data['id'])
		 && ($data['parent_id'] == 0))
		{
			$data['parent_id'] = self::getRootId();
		}

		return $data['parent_id'];
	}
public function automaticParentId ( $ data ) { if ( ! isset ( $ data [ 'parent_id' ] ) ) { $ data [ 'parent_id' ] = 0 ; } if ( ( ! isset ( $ data [ 'id' ] ) || ! $ data [ 'id' ] ) && ( $ data [ 'parent_id' ] == 0 ) ) { $ data [ 'parent_id' ] = self :: getRootId ( ) ; } return $ data [ 'parent_id' ] ; }
Generates automatic parent_id field value

@param   array   $data  the data being saved
@return  string
Generates automatic parent_id field value